mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
* data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
invoked, yydestruct the lookahead. * tests/calc.at (Calculator $1): Update the expected lengths of traces: there is an added line for the discarded lookahead. * doc/bison.texinfo (Destructor Decl): Some rewording. Define "discarded" symbols.
This commit is contained in:
@@ -1916,7 +1916,13 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
|
||||
yyposn = yystack.yytops.yystates[0]->yyposn;
|
||||
}
|
||||
yyDone:
|
||||
;
|
||||
/* On YYABORT, free the lookahead. */
|
||||
if (yystack.yyerrflag == 1 && yytoken != YYEMPTY)
|
||||
{
|
||||
YY_SYMBOL_PRINT ("Error: discarding lookahead",
|
||||
yytoken, yylvalp, yyllocp);
|
||||
yydestruct (yytoken, yylvalp]b4_location_if([, yyllocp])[);
|
||||
}
|
||||
|
||||
yyfreeGLRStack (&yystack);
|
||||
return yystack.yyerrflag;
|
||||
|
||||
Reference in New Issue
Block a user