Port small part of master's 8901f32e so future ports are easier.

* data/lalr1.cc (yy::parser::yysyntax_error_): Always add second
argument, but name it in the function definition only when
verbose error messages are enabled and it'll thus be used.
(yy::parser::parse): Update use of yysyntax_error_.
This commit is contained in:
Joel E. Denny
2009-12-22 15:44:29 -05:00
parent 2728ac7ecd
commit 1e05521d4f
2 changed files with 12 additions and 6 deletions

View File

@@ -153,8 +153,7 @@ b4_user_stype
/// Generate an error message.
/// \param state the state where the error occurred.
/// \param tok the lookahead token.
virtual std::string yysyntax_error_ (int yystate]dnl
b4_error_verbose_if([, int tok])[);
virtual std::string yysyntax_error_ (int yystate, int tok);
#if YYDEBUG
/// \brief Report a symbol value on the debug stream.
@@ -726,8 +725,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
if (!yyerrstatus_)
{
++yynerrs_;
error (yylloc, yysyntax_error_ (yystate]dnl
b4_error_verbose_if([, yytoken])[));
error (yylloc, yysyntax_error_ (yystate, yytoken));
}
yyerror_range[0] = yylloc;
@@ -851,8 +849,8 @@ b4_error_verbose_if([, yytoken])[));
// Generate an error message.
std::string
]b4_parser_class_name[::yysyntax_error_ (int yystate]dnl
b4_error_verbose_if([, int tok])[)
]b4_parser_class_name[::yysyntax_error_ (int yystate, int]dnl
b4_error_verbose_if([ tok])[)
{
std::string res;
YYUSE (yystate);