On 25/09/2021 08:26, Jim Robinson wrote:
> Oh, I was not suggesting you change v2.  I can do that easily enough
> myself and install a patched version.  What I was wondering was whether
> or not doing so might introduce some critical bug.

In Beancount v2 some upper case characters are valid transaction flags.

Depending on where in the lexer definition you inserted the rule that
recognizes single upper case characters as commodity symbols, either
some single uppercase characters will be miss classified as currency
symbols when they are flags, or the other way around, resulting in
syntax errors in the grammar. The Beancount lexer is not context aware,
thus there is no way out of this and this is the main reason for the
current lexer behavior.

While upper case characters as flags are not very common, they are used
internally by Beancount to mark some transactions that are inserted
automatically at booking time.

The v3 parser requires single uppercase character flags to be prefixed
with a quote symbol thus resolving the ambiguity.

Cheers,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/d209335b-7981-0ec0-422f-803e3210a0e0%40grinta.net.

Reply via email to