From cde8c0a0e6a8be1af32ff4dafd9ad60d35286cba Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 19 Jun 2019 08:24:34 +0200 Subject: [PATCH] d: prefer delegation to duplication * data/skeletons/lalr1.d: Delegate the construction of the scanner. --- data/skeletons/lalr1.d | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/data/skeletons/lalr1.d b/data/skeletons/lalr1.d index 7c9d6341..b30bce60 100644 --- a/data/skeletons/lalr1.d +++ b/data/skeletons/lalr1.d @@ -260,17 +260,15 @@ b4_user_union_members ]b4_lexer_if([[ /** - * Instantiates the Bison-generated parser. + * Instantiate the Bison-generated parser. */ public this] (b4_parse_param_decl([b4_lex_param_decl])[) { - this.yylexer = new YYLexer(]b4_lex_param_call[); - this.yyDebugStream = stderr; -]b4_parse_param_cons[ + this (new YYLexer(]b4_lex_param_call[)); } ]])[ /** - * Instantiates the Bison-generated parser. + * Instantiate the Bison-generated parser. * @@param yylexer The scanner that will supply tokens to the parser. */ ]b4_lexer_if([[protected]], [[public]]) [this (]b4_parse_param_decl([[Lexer yylexer]])[) {