* data/glr.c (YYRECOVERING): Define to be a function-like macro

with no arguments, not as an object-like macro.  This is for
compatibility with data/yacc.c.  Problem reported by John P. Hartmann in
<http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
* doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
Document this.
This commit is contained in:
Paul Eggert
2006-05-30 23:45:04 +00:00
parent 2c08afa5dd
commit 0210398466
3 changed files with 20 additions and 9 deletions

View File

@@ -1,3 +1,12 @@
2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
* data/glr.c (YYRECOVERING): Define to be a function-like macro
with no arguments, not as an object-like macro. This is for
compatibility with data/yacc.c. Problem reported by John P. Hartmann in
<http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
* doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
Document this.
2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu> 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
* src/getargs.c (usage): Back out yesterday's modification of the * src/getargs.c (usage): Back out yesterday's modification of the

View File

@@ -906,7 +906,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
# undef YYERROR # undef YYERROR
# define YYERROR return yyerrok, yyerr # define YYERROR return yyerrok, yyerr
# undef YYRECOVERING # undef YYRECOVERING
# define YYRECOVERING (yystackp->yyerrState != 0) # define YYRECOVERING() (yystackp->yyerrState != 0)
# undef yyclearin # undef yyclearin
# define yyclearin (yychar = YYEMPTY) # define yyclearin (yychar = YYEMPTY)
# undef YYFILL # undef YYFILL

View File

@@ -4892,8 +4892,9 @@ the @samp{YYERROR;} statement. @xref{Error Recovery}.
@end deffn @end deffn
@deffn {Macro} YYRECOVERING @deffn {Macro} YYRECOVERING
This macro stands for an expression that has the value 1 when the parser @findex YYRECOVERING
is recovering from a syntax error, and 0 the rest of the time. The expression @code{YYRECOVERING ()} yields 1 when the parser
is recovering from a syntax error, and 0 otherwise.
@xref{Error Recovery}. @xref{Error Recovery}.
@end deffn @end deffn
@@ -6003,10 +6004,10 @@ probably correct. The previous look-ahead token ought to be discarded
with @samp{yyclearin;}. with @samp{yyclearin;}.
@vindex YYRECOVERING @vindex YYRECOVERING
The macro @code{YYRECOVERING} stands for an expression that has the The expression @code{YYRECOVERING ()} yields 1 when the parser
value 1 when the parser is recovering from a syntax error, and 0 the is recovering from a syntax error, and 0 otherwise.
rest of the time. A value of 1 indicates that error messages are Syntax error diagnostics are suppressed while recovering from a syntax
currently suppressed for new syntax errors. error.
@node Context Dependency @node Context Dependency
@chapter Handling Context Dependencies @chapter Handling Context Dependencies
@@ -8469,8 +8470,9 @@ Conventions for Pure Parsers}.
@end deffn @end deffn
@deffn {Macro} YYRECOVERING @deffn {Macro} YYRECOVERING
Macro whose value indicates whether the parser is recovering from a The expression @code{YYRECOVERING ()} yields 1 when the parser
syntax error. @xref{Action Features, ,Special Features for Use in Actions}. is recovering from a syntax error, and 0 otherwise.
@xref{Action Features, ,Special Features for Use in Actions}.
@end deffn @end deffn
@deffn {Macro} YYSTACK_USE_ALLOCA @deffn {Macro} YYSTACK_USE_ALLOCA