jison icon indicating copy to clipboard operation
jison copied to clipboard

Stop silencing useful information.

Open joelburget opened this issue 10 years ago • 16 comments

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'

joelburget avatar Nov 03 '14 22:11 joelburget

:+1: This would have been very helpful to me in the past.

wavebeem avatar Dec 07 '14 21:12 wavebeem

+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.

cvializ avatar Feb 24 '15 04:02 cvializ

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.

nolanlawson avatar Mar 01 '15 00:03 nolanlawson

:+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.

gumgl avatar Sep 12 '15 10:09 gumgl

+1

toms-dev avatar Mar 04 '16 10:03 toms-dev

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

techtonik avatar Mar 04 '16 20:03 techtonik

+1

mcCURS0R avatar Jul 03 '16 18:07 mcCURS0R

👍

I just hacked the changed into my local copy of JISON, and suddenly I get useful error messages.

DanielSWolf avatar Aug 02 '16 11:08 DanielSWolf

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.

DanielSWolf avatar Aug 02 '16 12:08 DanielSWolf

Any reason why this hasn't been merged in two years?

warrenseine avatar Sep 30 '16 13:09 warrenseine

Because @zaach is missing?

techtonik avatar Oct 03 '16 07:10 techtonik

+1

vsych avatar Mar 17 '17 02:03 vsych

@zaach This is an essential fix for anyone developing a complex grammar. Please merge!

octachrome avatar Mar 14 '18 09:03 octachrome

Try https://www.npmjs.com/package/jison-gho ?

techtonik avatar May 07 '18 21:05 techtonik

Abandoned project with useless error messages...

john-burns-arundo avatar Jul 26 '18 21:07 john-burns-arundo

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 .

toms-dev avatar Jul 26 '18 21:07 toms-dev