mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Flush erred token
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3a1199f41
commit
e5d10cda07
1 changed files with 3 additions and 0 deletions
3
parse.y
3
parse.y
|
@ -4676,6 +4676,7 @@ parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
|
||||||
if (!yylloc) {
|
if (!yylloc) {
|
||||||
RUBY_SET_YYLLOC(current);
|
RUBY_SET_YYLLOC(current);
|
||||||
yylloc = ¤t;
|
yylloc = ¤t;
|
||||||
|
token_flush(p);
|
||||||
}
|
}
|
||||||
else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
|
else if ((p->ruby_sourceline != yylloc->beg_pos.lineno &&
|
||||||
p->ruby_sourceline != yylloc->end_pos.lineno) ||
|
p->ruby_sourceline != yylloc->end_pos.lineno) ||
|
||||||
|
@ -4765,6 +4766,7 @@ parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
|
||||||
#else
|
#else
|
||||||
dispatch1(parse_error, STR_NEW2(msg));
|
dispatch1(parse_error, STR_NEW2(msg));
|
||||||
ripper_error(p);
|
ripper_error(p);
|
||||||
|
token_flush(p);
|
||||||
#endif /* !RIPPER */
|
#endif /* !RIPPER */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -11195,6 +11197,7 @@ parser_compile_error(struct parser_params *p, const char *fmt, ...)
|
||||||
rb_long2int(p->lex.pcur - p->lex.pbeg),
|
rb_long2int(p->lex.pcur - p->lex.pbeg),
|
||||||
p->enc, fmt, ap);
|
p->enc, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
token_flush(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue