Skip to content

Commit

Permalink
fix checkActionBlock(): fix off-by-one mistake when this one reports …
Browse files Browse the repository at this point in the history
…about a piece of action code which "does not compile": lexer and parser line tracking yylloc info starts counting at line ONE(1) instead of ZERO(0) hence we do NOT need to compensate when bumping down the action code before parsing/validating it in here.
  • Loading branch information
GerHobbelt committed Oct 30, 2017
1 parent 008454a commit 0e3ee7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/helpers-lib/parse-code-chunk-to-AST.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function checkActionBlock(src, yylloc) {
// make sure reasonable line numbers, etc. are reported in any
// potential parse errors by pushing the source code down:
if (yylloc && yylloc.first_line > 0) {
var cnt = yylloc.first_line + 1;
var cnt = yylloc.first_line;
var lines = new Array(cnt);
src = lines.join('\n') + src;
}
Expand Down

0 comments on commit 0e3ee7b

Please sign in to comment.