Skip to content

Commit

Permalink
d: remove support for parse.error verbose
Browse files Browse the repository at this point in the history
Without the history, D should not support this option. Before the
removal, 'detailed' and 'verbose' options generated the same code.

* data/skeletons/lalr1.d: Here.
* doc/bison.texi: Adapt tests to use 'detailed' instead of 'verbose'.
* tests/calc.at: Document it.
  • Loading branch information
adelavais authored and akimd committed Jan 7, 2021
1 parent f859462 commit c13b3c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions data/skeletons/lalr1.d
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ m4_popdef([b4_at_dollar])])dnl
{]b4_parse_error_bmatch(
[custom], [[
yylexer.reportSyntaxError(yyctx);]],
[detailed\|verbose], [[
[detailed], [[
if (yyctx.getToken() != ]b4_symbol(empty, kind)[)
{
// FIXME: This method of building the message is not compatible
Expand Down Expand Up @@ -732,7 +732,7 @@ m4_popdef([b4_at_dollar])])dnl
}
]b4_parse_error_bmatch(
[detailed\|verbose], [[
[detailed], [[
private int yysyntaxErrorArguments(Context yyctx, SymbolKind[] yyarg, int yyargn) {
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action,
Expand Down
2 changes: 1 addition & 1 deletion doc/bison.texi
Original file line number Diff line number Diff line change
Expand Up @@ -13919,7 +13919,7 @@ Run the syntactic analysis, and return @code{true} on success,
@deftypemethod {YYParser} {boolean} getErrorVerbose()
@deftypemethodx {YYParser} {void} setErrorVerbose(boolean @var{verbose})
Get or set the option to produce verbose error messages. These are only
available with @samp{%define parse.error detailed} (or @samp{verbose}),
available with @samp{%define parse.error detailed},
which also turns on verbose error messages.
@end deftypemethod

Expand Down
2 changes: 1 addition & 1 deletion examples/d/calc/calc.y
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%language "D"

%define api.parser.class {Calc}
%define parse.error verbose
%define parse.error detailed
%define parse.trace

%locations
Expand Down
2 changes: 1 addition & 1 deletion examples/d/simple/calc.y
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%language "D"

%define api.parser.class {Calc}
%define parse.error verbose
%define parse.error detailed

%union {
int ival;
Expand Down
17 changes: 8 additions & 9 deletions tests/calc.at
Original file line number Diff line number Diff line change
Expand Up @@ -1453,26 +1453,25 @@ m4_define([AT_CHECK_CALC_LALR1_D],
AT_CHECK_CALC_LALR1_D([])
AT_CHECK_CALC_LALR1_D([%locations])
#AT_CHECK_CALC_LALR1_D([%locations %define api.location.type {Span}])
AT_CHECK_CALC_LALR1_D([%define parse.error verbose %define api.prefix {calc} %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error detailed %define api.prefix {calc} %verbose])

AT_CHECK_CALC_LALR1_D([%debug])

AT_CHECK_CALC_LALR1_D([%define parse.error custom])
AT_CHECK_CALC_LALR1_D([%locations %define parse.error custom])
AT_CHECK_CALC_LALR1_D([%locations %define parse.error detailed])
AT_CHECK_CALC_LALR1_D([%locations %define parse.error simple])
AT_CHECK_CALC_LALR1_D([%locations %define parse.error verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error verbose %debug %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error verbose %debug %define api.token.prefix {TOK_} %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error verbose %debug %define api.symbol.prefix {SYMB_} %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error verbose %debug %define api.symbol.prefix {SYMB_} %define api.token.prefix {TOK_} %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error detailed %debug %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error detailed %debug %define api.token.prefix {TOK_} %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error detailed %debug %define api.symbol.prefix {SYMB_} %verbose])
AT_CHECK_CALC_LALR1_D([%define parse.error detailed %debug %define api.symbol.prefix {SYMB_} %define api.token.prefix {TOK_} %verbose])

AT_CHECK_CALC_LALR1_D([%locations %define parse.lac full %define parse.error verbose])
AT_CHECK_CALC_LALR1_D([%locations %define parse.lac full %define parse.error detailed])
AT_CHECK_CALC_LALR1_D([%locations %define parse.lac full %define parse.error custom])
AT_CHECK_CALC_LALR1_D([%locations %define parse.lac full %define parse.error detailed %define parse.trace])

#AT_CHECK_CALC_LALR1_D([%locations %define parse.error verbose %debug %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}])
#AT_CHECK_CALC_LALR1_D([%locations %define parse.error verbose %debug %define api.prefix {calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}])
#AT_CHECK_CALC_LALR1_D([%locations %define parse.error detailed %debug %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}])
#AT_CHECK_CALC_LALR1_D([%locations %define parse.error detailed %debug %define api.prefix {calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}])


# ----------------------- #
Expand Down

0 comments on commit c13b3c0

Please sign in to comment.