mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
yacc: fix YYBACKUP.
Reported by David Kastrup: https://lists.gnu.org/archive/html/bug-bison/2011-10/msg00002.html. * data/yacc.c (YYBACKUP): Accept rhs size. Restore the proper state value. * TODO (YYBACKUP): Make it... * tests/actions.at: a new test case. * NEWS, THANKS: Update.
This commit is contained in:
@@ -646,11 +646,12 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
|
||||
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
if (yychar == YYEMPTY) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
YYPOPSTACK (1); \]b4_lac_if([[
|
||||
YYPOPSTACK (yylen); \
|
||||
yystate = *yyssp; \]b4_lac_if([[
|
||||
YY_LAC_DISCARD ("YYBACKUP"); \]])[
|
||||
goto yybackup; \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user