Thank you for the explanation. I guess I'll just use <exchange>_<symbol> in the interim (I don't want to have special logic in place for symbols based on how long they are).
On Saturday, September 25, 2021 at 2:44:09 AM UTC-7 [email protected] wrote: > 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/1f397ce1-40a4-426c-9755-e614d286f1c8n%40googlegroups.com.
