On Thu, Aug 9, 2018 at 7:28 PM <shreedharhardi...@gmail.com> wrote: > >> >> Limitations on the lexer. >> At some point I intend to rewrite it as a custom lexer instead of using >> flex. >> > > Hmm.. so you're seeing other pains with it? >
Irregular use of whitespace based on context. Or maybe I wasn't able to wrangle it properly (not an expert). > I believe YACC (bison) can do some basic lexical analysis. I haven't gone > through all of lexer.l to know the complexity myself. > It's the lexer that's at issue, the parser generator works fine. If I wrote my own lexer I could handle the special case of whitespace and do some lookahead. I will, eventually (it's not difficult). Hasn't been a huge priority. >> Agreed it should be documented better (feel free to suggest in the doc, >> I'll accept). >> >> Sure, I can do that. > > >> >> >>> How can I go about flagging transactions in a custom way? Using metadata >>> seems like one way (although, I did hope that there was a way to use custom >>> flags) >>> >> >> Yes, that, or tags. >> >> >> Would it work if the relevant line in lexer.l is changed to > [!&#?%A-Za-z]? > I'm pretty sure that's the first thing I wrote, so already tried. > The letters allowed would then be a superset of those defined as macros in > core.flags.py. Also, do you have a sense of how much testing that would > require? If it's not much, I can probably create a PR with the changes and > tests (in lexer_test.py and/or parser_test.py), if you're ok going that > route... >> >> >> >>> >>> Thanks, >>> Shree >>> >>> PS: I should also mention that I'm not very familiar with YACC - so I >>> might also be missing something. >>> >> >> No you're right, it's defined that way. >> >> >> >> >> >>> -- >>> 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 beancount+...@googlegroups.com. >>> To post to this group, send email to bean...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/beancount/14ac7f0c-b4eb-481d-8152-9db28ad04f79%40googlegroups.com >>> <https://groups.google.com/d/msgid/beancount/14ac7f0c-b4eb-481d-8152-9db28ad04f79%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > 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 beancount+unsubscr...@googlegroups.com. > To post to this group, send email to beancount@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/9d833fe5-546e-4076-9b7d-1006da24f0af%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/9d833fe5-546e-4076-9b7d-1006da24f0af%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 beancount+unsubscr...@googlegroups.com. To post to this group, send email to beancount@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhO3d4%3D3K9GYRSgv44q9Pc1arK4xCNS%2B%2B8LSY-edHmPF3A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.