Skip to content

Commit

Permalink
dummy target won't be START
Browse files Browse the repository at this point in the history
  • Loading branch information
nurse committed Jun 20, 2023
1 parent 1bab4cb commit 4449004
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/racc/grammarfileparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ def _add_many1_rule(prev)
end

def _add_group_rule(enum)
target = @grammar.intern("-temp-group")
target = @grammar.intern("-temp-group", true)
rules, _ = _add_rule_block(target, enum)
target_name = rules.map{|syms, sprec| syms.join("-")}.join("|")
@group_rule_registry ||= {}
unless target = @group_rule_registry[target_name]
target = @grammar.intern("-group@#{target_name}")
target = @grammar.intern("-group@#{target_name}", true)
@group_rule_registry[target_name] = target
src = SourceText.new("result = val", __FILE__, __LINE__)
act = UserAction.source_text(src)
Expand All @@ -332,7 +332,7 @@ def _add_group_rule(enum)
end

def _gen_target_name(type, sym)
@grammar.intern("-#{type}@#{sym.value}")
@grammar.intern("-#{type}@#{sym.value}", true)
end

def add_rule(target, list, sprec)
Expand Down

0 comments on commit 4449004

Please sign in to comment.