mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
In verbose parse error message, don't report `error' as an
expected token. * tests/actions.at (Printers and Destructors): Adjust. * tests/calc.at (Calculator $1): Adjust. * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose error message, do not report the parser accepts the error token in that state.
This commit is contained in:
@@ -1512,7 +1512,7 @@ yyreportParseError (yyGLRStack* yystack, YYSTYPE* yylvalp, YYLTYPE* yyllocp)
|
||||
yyprefix = ", expecting ";
|
||||
for (yyx = yyn < 0 ? -yyn : 0; yyx < yytname_size && yycount <= 5;
|
||||
yyx += 1)
|
||||
if (yycheck[yyx + yyn] == yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
yysize += strlen (yytokenName (yyx)) + strlen (yyprefix),
|
||||
yycount += 1, yyprefix = " or ";
|
||||
yymsg = yyp = (char*) malloc (yysize);
|
||||
|
||||
Reference in New Issue
Block a user