mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
d: fix interface syntax error
Fix syntax error regarding interface inheritance of the Lexer. It appeared when the `%code lexer` option was used. Reported by ledaniel2. <https://github.com/akimd/bison/issues/84> * data/skeletons/lalr1.d: Fix syntax. * tests/d.at: Test it.
This commit is contained in:
committed by
Akim Demaille
parent
c025891547
commit
be4528096e
@@ -269,9 +269,10 @@ b4_user_union_members
|
||||
}
|
||||
}]])[
|
||||
|
||||
]b4_lexer_if([[ private class YYLexer implements Lexer {
|
||||
]b4_lexer_if([[private class YYLexer: Lexer
|
||||
{
|
||||
]b4_percent_code_get([[lexer]])[
|
||||
}
|
||||
}
|
||||
]])[
|
||||
/** The object doing lexical analysis for us. */
|
||||
private Lexer yylexer;
|
||||
|
||||
@@ -112,6 +112,13 @@ AT_CHECK_D_GREP([[class YYParser : BaseClass]])
|
||||
AT_CHECK_D_MINIMAL([%define api.parser.extends {Interface}], [], [], [interface Interface {}])
|
||||
AT_CHECK_D_GREP([[class YYParser : Interface]])
|
||||
|
||||
AT_CHECK_D_MINIMAL([%code lexer
|
||||
{
|
||||
Symbol yylex () {return Symbol();}
|
||||
void yyerror (string s) {import std.stdio;writeln(s);}
|
||||
}], [], [], [])
|
||||
AT_CHECK_D_GREP([[private class YYLexer: Lexer]])
|
||||
|
||||
AT_CHECK_D_MINIMAL(
|
||||
[%define api.parser.extends {BaseClass}
|
||||
%define api.parser.implements {Interface}], [], [],
|
||||
|
||||
Reference in New Issue
Block a user