summaryrefslogtreecommitdiff
path: root/src/parse-gram.c
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-04-27 07:08:55 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-04-27 07:08:55 +0200
commit5f3cd49acc8c196a88128924459bc74a9401fded (patch)
treec68860cde7b38111bf48276c39cc7dbcb075ddf0 /src/parse-gram.c
parente6d928c4e88012a4adf5247f6b17b28a06861c81 (diff)
downloadbison-5f3cd49acc8c196a88128924459bc74a9401fded.tar.gz
regen
Diffstat (limited to 'src/parse-gram.c')
-rw-r--r--src/parse-gram.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/parse-gram.c b/src/parse-gram.c
index 4c5ca366..610f2004 100644
--- a/src/parse-gram.c
+++ b/src/parse-gram.c
@@ -1960,6 +1960,17 @@ yybackup:
yytoken = YYSYMBOL_YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
+ else if (yychar == GRAM_ERRCODE)
+ {
+ /* The scanner already issued an error message, process directly
+ to error recovery. But do not keep the error token as
+ lookahead, it is too special and may lead us to an endless
+ loop in error recovery. */
+ yychar = GRAM_UNDEF;
+ yytoken = YYSYMBOL_YYERRCODE;
+ yyerror_range[1] = yylloc;
+ goto yyerrlab1;
+ }
else
{
yytoken = YYTRANSLATE (yychar);
@@ -2640,7 +2651,6 @@ yyerrlab:
}
yyerror_range[1] = yylloc;
-
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an