kach / nearley

📜🔜🌲 Simple, fast, powerful parser toolkit for JavaScript.
https://nearley.js.org
MIT License
3.57k stars 231 forks source link

Leo enhancements for right recursion #614

Open jrh3 opened 2 years ago

jrh3 commented 2 years ago

This is regarding issues #391 and #312.

Changes to handle right recursion slow the benchmark tests down ~11%.

This change would somewhat address the video by Toby Ho, probably resulting in a factor of 10x instead of 200x. It would also address rule 2 of issue #312, but it still would not address rule 1 of issue #312, as that is middle recursive. Additional changes will address rule 1, but that results in a slowdown of ~45% for sample1k and ~20% for the other two benchmark tests.

Should I create a pull request for any of these changes?