no-context / moo

Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
BSD 3-Clause "New" or "Revised" License
814 stars 65 forks source link

Fix a bug, `queuedText` is not handled in `reset` #169

Closed hikerpig closed 2 years ago

hikerpig commented 2 years ago

In my project when using Nearley.js and moo.js together, after multiple times of parsing, sometimes the parser would throw an error. I find that is due to moo.js, when it resets, the queuedText is not handled. I think when it comes to reset and save, queuedText should be no different than queuedToken .