From 021039846636833e7a38887c9b28f1a4a7f0687c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 30 May 2006 23:45:04 +0000 Subject: [PATCH] * 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 . * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols): Document this. --- ChangeLog | 9 +++++++++ data/glr.c | 2 +- doc/bison.texinfo | 18 ++++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8eb003f0..f96983d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-05-30 Paul Eggert + + * 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 + . + * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols): + Document this. + 2006-05-30 Joel E. Denny * src/getargs.c (usage): Back out yesterday's modification of the diff --git a/data/glr.c b/data/glr.c index 486b8b98..b872bf40 100644 --- a/data/glr.c +++ b/data/glr.c @@ -906,7 +906,7 @@ yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp, # undef YYERROR # define YYERROR return yyerrok, yyerr # undef YYRECOVERING -# define YYRECOVERING (yystackp->yyerrState != 0) +# define YYRECOVERING() (yystackp->yyerrState != 0) # undef yyclearin # define yyclearin (yychar = YYEMPTY) # undef YYFILL diff --git a/doc/bison.texinfo b/doc/bison.texinfo index 40d08b87..6c67b593 100644 --- a/doc/bison.texinfo +++ b/doc/bison.texinfo @@ -4892,8 +4892,9 @@ the @samp{YYERROR;} statement. @xref{Error Recovery}. @end deffn @deffn {Macro} YYRECOVERING -This macro stands for an expression that has the value 1 when the parser -is recovering from a syntax error, and 0 the rest of the time. +@findex YYRECOVERING +The expression @code{YYRECOVERING ()} yields 1 when the parser +is recovering from a syntax error, and 0 otherwise. @xref{Error Recovery}. @end deffn @@ -6003,10 +6004,10 @@ probably correct. The previous look-ahead token ought to be discarded with @samp{yyclearin;}. @vindex YYRECOVERING -The macro @code{YYRECOVERING} stands for an expression that has the -value 1 when the parser is recovering from a syntax error, and 0 the -rest of the time. A value of 1 indicates that error messages are -currently suppressed for new syntax errors. +The expression @code{YYRECOVERING ()} yields 1 when the parser +is recovering from a syntax error, and 0 otherwise. +Syntax error diagnostics are suppressed while recovering from a syntax +error. @node Context Dependency @chapter Handling Context Dependencies @@ -8469,8 +8470,9 @@ Conventions for Pure Parsers}. @end deffn @deffn {Macro} YYRECOVERING -Macro whose value indicates whether the parser is recovering from a -syntax error. @xref{Action Features, ,Special Features for Use in Actions}. +The expression @code{YYRECOVERING ()} yields 1 when the parser +is recovering from a syntax error, and 0 otherwise. +@xref{Action Features, ,Special Features for Use in Actions}. @end deffn @deffn {Macro} YYSTACK_USE_ALLOCA -- 2.47.2