From 1e05521d4f74fc6770dd55e81c2fdc84191adf7b Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Tue, 22 Dec 2009 15:44:29 -0500 Subject: [PATCH] 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_. --- ChangeLog | 8 ++++++++ data/lalr1.cc | 10 ++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16d12a59..86bc8a03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-12-22 Joel E. Denny + + 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_. + 2009-12-29 Joel E. Denny portability: `<' and `>' are not always defined on addresses. diff --git a/data/lalr1.cc b/data/lalr1.cc index c36ba3de..a2d473db 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -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); -- 2.47.2