mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-27 05:03:07 +00:00
d: obey parse.error
* data/skeletons/lalr1.d (yysyntax_error): Let the dispatch be bison-time, not runtime.
This commit is contained in:
4
TODO
4
TODO
@@ -2,10 +2,6 @@
|
|||||||
** Deprecate YYPRINT
|
** Deprecate YYPRINT
|
||||||
The doc shows it too much.
|
The doc shows it too much.
|
||||||
|
|
||||||
** java, d: error.verbose
|
|
||||||
The code checks dynamically for error.verbose. It should be controlled by
|
|
||||||
M4.
|
|
||||||
|
|
||||||
** doc
|
** doc
|
||||||
I feel its ugly to use the GNU style to declare functions in the doc. It
|
I feel its ugly to use the GNU style to declare functions in the doc. It
|
||||||
generates tons of white space in the page, and may contribute to bad page
|
generates tons of white space in the page, and may contribute to bad page
|
||||||
|
|||||||
@@ -187,9 +187,6 @@ b4_user_union_members
|
|||||||
{
|
{
|
||||||
]b4_identification[
|
]b4_identification[
|
||||||
|
|
||||||
/** True if verbose error messages are enabled. */
|
|
||||||
public bool errorVerbose = ]b4_flag_value([error_verbose])[;
|
|
||||||
|
|
||||||
]b4_locations_if([[
|
]b4_locations_if([[
|
||||||
private final ]b4_location_type[ yylloc_from_stack (ref YYStack rhs, int n)
|
private final ]b4_location_type[ yylloc_from_stack (ref YYStack rhs, int n)
|
||||||
{
|
{
|
||||||
@@ -400,7 +397,8 @@ b4_user_union_members
|
|||||||
ref ]b4_yystype[ yyvaluep]dnl
|
ref ]b4_yystype[ yyvaluep]dnl
|
||||||
b4_locations_if([, ref ]b4_location_type[ yylocationp])[)
|
b4_locations_if([, ref ]b4_location_type[ yylocationp])[)
|
||||||
{
|
{
|
||||||
if (0 < yydebug) {
|
if (0 < yydebug)
|
||||||
|
{
|
||||||
string message = s ~ (yytype < yyntokens_ ? " token " : " nterm ")
|
string message = s ~ (yytype < yyntokens_ ? " token " : " nterm ")
|
||||||
~ yytname_[yytype] ~ " ("]b4_locations_if([
|
~ yytname_[yytype] ~ " ("]b4_locations_if([
|
||||||
~ yylocationp.toString() ~ ": "])[;
|
~ yylocationp.toString() ~ ": "])[;
|
||||||
@@ -667,9 +665,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
|
|
||||||
// Generate an error message.
|
// Generate an error message.
|
||||||
private final string yysyntax_error (int yystate, int tok)
|
private final string yysyntax_error (int yystate, int tok)
|
||||||
{
|
{]b4_error_verbose_if([[
|
||||||
if (errorVerbose)
|
|
||||||
{
|
|
||||||
/* There are many possibilities here to consider:
|
/* There are many possibilities here to consider:
|
||||||
- Assume YYFAIL is not used. It's too flawed to consider.
|
- Assume YYFAIL is not used. It's too flawed to consider.
|
||||||
See
|
See
|
||||||
@@ -736,9 +732,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}]])[
|
||||||
}
|
|
||||||
|
|
||||||
return "syntax error";
|
return "syntax error";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user