diff --git a/.gitignore b/.gitignore index 3f1af7895..39d9341e1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ node_modules # Editor backup files *.bak *~ -web/content/assets/js/jison.js \ No newline at end of file +web/content/assets/js/jison.js +.idea diff --git a/lib/jison.js b/lib/jison.js index d078056ee..d08ddb0a6 100755 --- a/lib/jison.js +++ b/lib/jison.js @@ -1493,7 +1493,8 @@ _handle_error: text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, - loc: yyloc, + loc: lexer.yylloc, + ruleId: stack.slice(stack.length - 2, stack.length).join('_'), expected: expected, recoverable: (error_rule_depth !== false) }); diff --git a/ports/comments.js b/ports/comments.js index 0633a2f21..e641a0656 100644 --- a/ports/comments.js +++ b/ports/comments.js @@ -142,7 +142,7 @@ parse: function parse(input) { } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); } - this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: this.lexer.yylloc, expected: expected}); } } if (action[0] instanceof Array && action.length > 1) { diff --git a/ports/csharp/Jison/Jison/Test/formula.js b/ports/csharp/Jison/Jison/Test/formula.js index e040e4acd..b7bfcd03e 100644 --- a/ports/csharp/Jison/Jison/Test/formula.js +++ b/ports/csharp/Jison/Jison/Test/formula.js @@ -696,7 +696,7 @@ _handle_error: text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, - loc: yyloc, + loc: this.lexer.yylloc, expected: expected, recoverable: (error_rule_depth !== false) });