Closed blais closed 9 months ago
Thanks for the report, I didn't know that syntax.
I usually refer to this document: https://beancount.github.io/docs/beancount_language_syntax.html and it looks like doesn't mention it.
But of course, I'd like this parser to accept any valid beancount syntax, so the ~
precision syntax should be supported.
Great! Id like to build something and learn some Rust in the process using your parser.
Local tolerance parsing looks like this in bison:
amount_tolerance:
number_expr currency
{
BUILDY(DECREF($1, $2),
$$.pyobj1, "amount", "OO", $1, $2);
$$.pyobj2 = Py_None;
Py_INCREF(Py_None);
}
| number_expr TILDE number_expr currency
{
BUILDY(DECREF($1, $4),
$$.pyobj1, "amount", "OO", $1, $4);
$$.pyobj2 = $3;
}
I added some text int he docs: https://docs.google.com/document/d/1wAMVrKIA2qtRGmoVDSUBJGmYZSygUaR0uOMW1GV3YE0/edit#heading=h.5jx4fqseqk64
Thank you very much. I'll look at this soon. It should be fairly easy to implement. If you want to give it a go yourself you can open a PR too. But don't feel like you have to, I can probably find the time for that this week or the next.
Thank you! :-) I now confirm this parser is able to grok my entire gnarly personal Beancount file.
Thanks for addressing all the other issues Jonathan. Updating and continuing on, I see the precision syntax fail: