Closed brucou closed 4 years ago
@kach alright I found the mistake, I changed the grammar.ne and forgot to generate the grammar.js with nearleyc
... so it was applying the previous compiled grammar to the new grammar.ne...
I don't know if there is an easy way to avoid that in the future. The only thing I can think about is a watcher which automatically compiles the grammar when it has changed. Closing this then.
@kach Lovely people, not sure if that is the right place to post (let me know if there is a stack overflow for it), but here we go:
I have the following grammar working fine in the playground:
For instance the string
| click inc / increment counter, render | click dec [a] / decrement counter, render
is correctly parsed in the playground into:However, when running this grammar in node or the browser, the parser fails. The error is reproduced in this sandbox: https://codesandbox.io/s/nearley-parsing-error-7fql6. The error message is as follows:
In case this matters, I run node 10.15 on windows 10.
What could be possibly wrong? I also fail to decipher the error messages.. Can anybody please help?