Simplify yysyntax_error_ use.

* data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
	type, but make it unnamed in the declaration when it is not used.
This commit is contained in:
Akim Demaille
2008-07-21 11:13:43 +02:00
parent 8b9c89fb65
commit d7f4d82382
2 changed files with 10 additions and 6 deletions

View File

@@ -1,3 +1,9 @@
2008-11-03 Akim Demaille <demaille@gostai.com>
Simplify yysyntax_error_ use.
* data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
type, but make it unnamed in the declaration when it is not used.
2008-11-03 Akim Demaille <demaille@gostai.com> 2008-11-03 Akim Demaille <demaille@gostai.com>
Let yy::variant::build return an lvalue. Let yy::variant::build return an lvalue.

View File

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