diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-14 04:35:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-14 04:35:28 +0000 |
commit | bc44acb5a34f9b54c6188cb081f03f1935ce07dd (patch) | |
tree | a871a27820120384875b96c3e0819e743ca03b1a /parse.y | |
parent | 42d9712e78744e19ac71a7c0eaa099ac9203e1b1 (diff) | |
download | ruby-bc44acb5a34f9b54c6188cb081f03f1935ce07dd.tar.gz |
parse.y: fix yyerror message
* parse.y (parser_yyerror): show the error line even if the error
is at the end.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -5260,11 +5260,10 @@ parser_yyerror(struct parser_params *parser, const char *msg) int i; p = lex_p; - while (lex_pbeg <= p) { - if (*p == '\n') break; + while (lex_pbeg < p) { + if (*(p-1) == '\n') break; p--; } - p++; pe = lex_p; while (pe < lex_pend) { |