1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Show the error line only when same as the current

This commit is contained in:
Nobuyoshi Nakada 2019-12-25 14:47:31 +09:00
parent 9808e01090
commit 56e002981f
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

13
parse.y
View file

@ -5631,7 +5631,18 @@ static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno
static inline void
parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
{
ruby_show_error_line(p->error_buffer, yylloc, p->ruby_sourceline, p->lex.lastline);
VALUE str;
int lineno = p->ruby_sourceline;
if (!yylloc) {
return;
}
else if (yylloc->beg_pos.lineno == lineno) {
str = p->lex.lastline;
}
else {
return;
}
ruby_show_error_line(p->error_buffer, yylloc, lineno, str);
}
static int