mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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:
@@ -667,7 +667,7 @@ b4_c_function([yyreport_parse_error],
|
||||
YYCHECK. */
|
||||
for (yyx = yyn < 0 ? -yyn : 0;
|
||||
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
|
||||
if (yycheck[yyx + yyn] == yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
|
||||
yysize += yystrlen ("parse error, unexpected ") + 1;
|
||||
yysize += yystrlen (yytname[yytype]);
|
||||
@@ -683,7 +683,7 @@ b4_c_function([yyreport_parse_error],
|
||||
for (yyx = yyn < 0 ? -yyn : 0;
|
||||
yyx < (int) (sizeof (yytname) / sizeof (char *));
|
||||
yyx++)
|
||||
if (yycheck[yyx + yyn] == yyx)
|
||||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||||
{
|
||||
const char *yyq = ! yycount ? ", expecting " : " or ";
|
||||
yyp = yystpcpy (yyp, yyq);
|
||||
|
||||
Reference in New Issue
Block a user