mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
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:
11
data/glr.c
11
data/glr.c
@@ -2076,9 +2076,11 @@ yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
||||
/*ARGSUSED*/ static void
|
||||
yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
||||
{
|
||||
if (yystackp->yyerrState == 0)
|
||||
{
|
||||
#if YYERROR_VERBOSE
|
||||
if (yystackp->yyerrState != 0)
|
||||
return;
|
||||
#if ! YYERROR_VERBOSE
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
#else
|
||||
int yyn;
|
||||
yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
||||
if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
||||
@@ -2175,11 +2177,10 @@ if (YYPACT_NINF < yyn && yyn <= YYLAST)
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||
#endif /* YYERROR_VERBOSE */
|
||||
yynerrs += 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
||||
yylval, and yylloc are the syntactic category, semantic value, and location
|
||||
|
||||
@@ -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");]])[
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user