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

part of #21: no concise error messages #34

Closed GerHobbelt closed 6 years ago

GerHobbelt commented 6 years ago

Extracting another part from #21:

No concise error messages?

-t flag generates too much extra output, while the classical jison reported nice concise error messages. classic jison:

$ node cool.js bad.cl
Parse error on line 12:
... type identifier *)Class b inherits A {
----------------------^
Expecting 'CLASS', got 'TYPEID'
C:\code\sandbox\[Stanford] Compilers\cool-jison\cool.js:394
                    throw new Error(errStr || 'Parsing halted while starting to recover from another error.');

jison-gho: too long output (impractical other than deep debugging)

I could not find a similar mechanism for error messaging in your fork (or it does not work on my grammar for some reason). I'd like to have a kind of concise error messages that used to be in classical jison in my final compiler.

GerHobbelt commented 6 years ago

Dupe of #23. See there for more.