Show the error line only when same as the current
This commit is contained in:
parent
9808e01090
commit
56e002981f
13
parse.y
13
parse.y
@ -5631,7 +5631,18 @@ static void ruby_show_error_line(VALUE errbuf, const YYLTYPE *yylloc, int lineno
|
|||||||
static inline void
|
static inline void
|
||||||
parser_show_error_line(struct parser_params *p, const YYLTYPE *yylloc)
|
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
|
static int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user