GerHobbelt / jison

bison / YACC / LEX in JavaScript (LALR(1), SLR(1), etc. lexer/parser generator)
https://gerhobbelt.github.io/jison/
MIT License
118 stars 20 forks source link

Do parsers share a global state? #56

Closed hugozap closed 4 years ago

hugozap commented 4 years ago

I'm using a new instance of Parser and the first time I execute it it works ok, but the second time it hangs. I assumed using a new instance would create a clean state but looks like I need to reset some global state?

This is what I'm currently using:

const Parser = require('myparser').Parser
....
//This will run multiple times
const p = new Parser();
p.parse(...)
hugozap commented 4 years ago

Using 'parser' instead of the Parser class works.