Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make esprima errors more intelligible (caused by faults in user action code test-parse-passes during grammar compile) #60

Open
GerHobbelt opened this issue Nov 16, 2020 · 0 comments

Comments

@GerHobbelt
Copy link
Owner

Here's one with bleeding edge jison-gho: not useful as it is. Try to catch these buggers and make them behave like the extended yyerror reports:

(Also note the bloody stacktrace is only about a part in esprima itself, which is extremely useless for error diagnosis of the action code which is parsed through there. 😭 )


$ make issue-360
node ../dist/cli-cjs.js -o ./output/issue-360/ --main --export-ast+ ./issue-360.json
JISON output for module [issue_360] has been written to file: output\issue-360\issue-360.js
macros keylen: 5
macros keylen B: 8
indented action: {
  entry: '/* skip whitespace */',
  action: 'function',
  actionHasLF: false
}

W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima.js:1995
                throw this.unexpectedTokenError(token, message);
                ^
Error: Line 13: Unexpected token }
    at ErrorHandler.constructError (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima.js:5012:22)
    at ErrorHandler.createError (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima.js:5028:27)
    at JSXParser.Parser.unexpectedTokenError (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima.j
s:1985:39)
    at JSXParser.Parser.throwUnexpectedToken (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima.j
s:1995:21)
    at JSXParser.Parser.parseVariableIdentifier (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprim
a.js:3594:27)
    at JSXParser.Parser.parseFunctionDeclaration (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\espri
ma.js:4316:24)
    at JSXParser.Parser.parseStatementListItem (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima
.js:3379:39)
    at JSXParser.Parser.parseFunctionSourceElements (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\es
prima.js:4195:29)
    at JSXParser.Parser.parseFunctionDeclaration (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\espri
ma.js:4347:26)
    at JSXParser.Parser.parseStatementListItem (W:\Projects\sites\library.visyond.gov\80\lib\tooling\jison\node_modules\recast\node_modules\esprima\dist\esprima
.js:3379:39) {
  index: 165,
  lineNumber: 13,
  description: 'Unexpected token }'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant