diff --git a/data/skeletons/lalr1.d b/data/skeletons/lalr1.d index 3195dbf8..01175325 100644 --- a/data/skeletons/lalr1.d +++ b/data/skeletons/lalr1.d @@ -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; diff --git a/tests/d.at b/tests/d.at index 6be53eef..347e868c 100644 --- a/tests/d.at +++ b/tests/d.at @@ -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}], [], [],