Let yyerror always receive the msg as last argument, so that

yyerror can be variadic.
* data/yacc.c (b4_yyerror_args): New.
Use it when calling yyerror.
* data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
Use it when calling yyerror.
* doc/bison.texinfo (Error Reporting): Adjust.
* tests/calc.at (_AT_DATA_CALC_Y): Adjust.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
This commit is contained in:
Akim Demaille
2002-11-07 12:52:19 +00:00
parent 0e25cad542
commit 93724f139a
6 changed files with 74 additions and 33 deletions

View File

@@ -36,10 +36,11 @@ $1
]m4_bmatch([$2], [stmtMerge],
[ static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);])[
#define YYINITDEPTH 10
int yyerror (const char *s
int yyerror (
#if YYPURE && YYLSP_NEEDED
, YYLTYPE *yylocation
YYLTYPE *yylocation,
#endif
const char *s
);
#if YYPURE
@@ -157,10 +158,11 @@ yylex ()
}
int
yyerror (const char *s
yyerror (
#if YYPURE && YYLSP_NEEDED
, YYLTYPE *yylocation
YYLTYPE *yylocation,
#endif
const char *s
)
{
#if YYPURE && YYLSP_NEEDED