summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-12 04:11:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-12 04:11:41 +0000
commite5d10cda07b23682e5e4e64d1324e4d3247d4785 (patch)
treea853f180d6209904f67ebdea15bc6cea52aeed82 /parse.y
parenta3a1199f413f7a96c4c90c7513c832838379e468 (diff)
Flush erred token
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 4db6ac8e3d..42f1ff3fe5 100644
--- a/parse.y
+++ b/parse.y
@@ -4676,6 +4676,7 @@ parser_yyerror(struct parser_params *p, const YYLTYPE *yylloc, const char *msg)
if (!yylloc) {
RUBY_SET_YYLLOC(current);
yylloc = &current;
+ token_flush(p);
}
else if ((p->ruby_sourceline != yylloc->beg_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
dispatch1(parse_error, STR_NEW2(msg));
ripper_error(p);
+ token_flush(p);
#endif /* !RIPPER */
return 0;
}
@@ -11195,6 +11197,7 @@ parser_compile_error(struct parser_params *p, const char *fmt, ...)
rb_long2int(p->lex.pcur - p->lex.pbeg),
p->enc, fmt, ap);
va_end(ap);
+ token_flush(p);
}
static size_t