Skip to content

Commit

Permalink
Merge pull request #311 from yui-knk/redundant_variables
Browse files Browse the repository at this point in the history
Remove redundant assignments
  • Loading branch information
yui-knk authored Dec 24, 2023
2 parents 95909d0 + 861b74c commit ee2421e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/lrama/grammar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ee2421e

Please sign in to comment.