jison
jison copied to clipboard
Stop silencing useful information.
The thrown errors didn't hold any useful information and made debugging impossible.
Before:
Error: Could not parse jison grammar
After:
Error: Parse error on line 86:
... ;expatom = atom '^' nat
--------------------^
Expecting ':', got 'ID'
:+1: This would have been very helpful to me in the past.
+1 I get useful error messages in v0.4.13, but v0.4.14 and v0.4.15 do not show useful error information any more. Please consider merging this PR or resolving the problem another way.
Do we have any idea why the code was changed in the first place? Presumably there was a good reason to put the try/catches in there.
:+1: This fix works great on 0.4.15. Went from a generic "could not parse" to specific info on the syntax error. Thanks! It should be merged.
+1
It is better to rethrow exceptions than silence them. This way code shows that there is an exception that might need a handler. https://github.com/techtonik/jison/commit/db4430326a3d54f8b08cbc3de12ab061ca6a7279
+1
👍
I just hacked the changed into my local copy of JISON, and suddenly I get useful error messages.
Seems like exception silencing got introduced with commit ea116547b3. The commit message doesn't mention this:
edit docs, cleanup cli.processGrammars
options argument properties are documented better. Optional and default args specified better. jsonMode arg to cli.processGrammars means something.
Any reason why this hasn't been merged in two years?
Because @zaach is missing?
+1
@zaach This is an essential fix for anyone developing a complex grammar. Please merge!
Try https://www.npmjs.com/package/jison-gho ?
Abandoned project with useless error messages...
Yep sadly... Better switch to the Typescript front-end of Antlr https://github.com/tunnelvisionlabs/antlr4ts/blob/master/README.md
On Thu, Jul 26, 2018, 23:26 John Burns Arundo [email protected] wrote:
Abandoned project with useless error messages...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaach/jison/pull/258#issuecomment-408240233, or mute the thread https://github.com/notifications/unsubscribe-auth/AC2D-VdJsjBBdSDh5WjnyiQmYqwyIklbks5uKjP9gaJpZM4C2hNr .