From 861b74cd7e8646a326efbb5e440c73fc68be1dcf Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 24 Dec 2023 11:58:48 +0900 Subject: [PATCH] Remove redundant assignments --- lib/lrama/grammar.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/lrama/grammar.rb b/lib/lrama/grammar.rb index 42337682..8fed581f 100644 --- a/lib/lrama/grammar.rb +++ b/lib/lrama/grammar.rb @@ -361,10 +361,8 @@ def append_special_symbols def normalize_rules # Add $accept rule to the top of rules - accept = @accept_symbol - eof = @eof_symbol lineno = @rule_builders.first ? @rule_builders.first.line : 0 - @rules << Rule.new(id: @rule_counter.increment, _lhs: accept.id, _rhs: [@rule_builders.first.lhs, eof.id], token_code: nil, lineno: lineno) + @rules << Rule.new(id: @rule_counter.increment, _lhs: @accept_symbol.id, _rhs: [@rule_builders.first.lhs, @eof_symbol.id], token_code: nil, lineno: lineno) setup_rules