yysyntax_error: more preparation for readability of next patch.

There are no behavioral changes here.
* data/glr.c (yyreportSyntaxError): Reorganize.
* data/lalr1.cc (yy::parser::yysyntax_error_): Reorganize.
* tests/conflicts.at (parse.error=verbose and consistent errors):
Reorganize.
This commit is contained in:
Joel E. Denny
2010-11-07 09:45:18 -05:00
parent b4bbc4a03c
commit 25a648d8a6
4 changed files with 101 additions and 76 deletions

View File

@@ -977,8 +977,8 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
]b4_parser_class_name[::yysyntax_error_ (]dnl
b4_error_verbose_if([state_type yystate, int yytoken],
[int, int])[)
{
std::string yyres;]b4_error_verbose_if([[
{]b4_error_verbose_if([[
std::string yyres;
int yyn = yypact_[yystate];
if (yypact_ninf_ < yyn && yyn <= yylast_)
{
@@ -1038,9 +1038,9 @@ b4_error_verbose_if([state_type yystate, int yytoken],
yyres += *yyp;
}
else
]])dnl
[ yyres = YY_("syntax error");
return yyres;
yyres = YY_("syntax error");
return yyres;]], [[
return YY_("syntax error");]])[
}