summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-05 16:44:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-05 16:44:43 +0900
commit1f544d671580dab465df56f42e142db4667f782e (patch)
tree2a89d6c51fe82f14846f82f1c1195b363a88d5ed /parse.y
parent5a961c37682383d5d439a16b912be62cd2d0a7f0 (diff)
Show the last line at unexpected end-of-input error
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 1 insertions, 3 deletions
diff --git a/parse.y b/parse.y
index 3d5ba3b1ea6..1f000a13de5 100644
--- a/parse.y
+++ b/parse.y
@@ -5995,9 +5995,7 @@ parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
yylloc = RUBY_SET_YYLLOC(current);
}
else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
- p->ruby_sourceline != yylloc->end_pos.lineno) ||
- (yylloc->beg_pos.lineno == yylloc->end_pos.lineno &&
- yylloc->beg_pos.column == yylloc->end_pos.column)) {
+ p->ruby_sourceline != yylloc->end_pos.lineno)) {
yylloc = 0;
}
compile_error(p, "%s", msg);