Closed stormbrew closed 13 years ago
Thanks!
I'll read up on the theory and might change the code around a bit, but I will merge this as soon as I can! kaspar
Hi stormbrew,
Maybe you've seen my post on the mailing list about this - here's a link: http://permalink.gmane.org/gmane.comp.lang.ruby.parslet/3
greetings, kaspar
These changes collectively implement direct left recursion. Note that one side effect is that not as much can be memoized. When all rules were being memoized, it made what in the grammar would have looked like a direct left-recursion into something more like an indirect left-recursion. It's possible that this is because I misunderstood something in either the implementation of parslet or the OMeta algorithm, but I've looked at other PEG parsers and they seem to be much less aggressive about memoization to begin with.
I also have some concern that the implementation I've used for reporting errors is incorrect or undercooked, but I'm not sure if there's an obvious better way that I'm missing.