Skip to content

Commit

Permalink
Merge pull request ruby#178 from nobu/fix-names
Browse files Browse the repository at this point in the history
Fix names
  • Loading branch information
hsbt authored Nov 3, 2021
2 parents 8eae41e + 1f52571 commit 78cf52e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/racc/grammar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,14 @@ def _defmetasyntax(type, id, action, &block)
if action
idbase = "#{type}@#{id}-#{@seqs[type] += 1}"
target = _wrap(idbase, "#{idbase}-core", action)
_regist("#{idbase}-core", &block)
_register("#{idbase}-core", &block)
else
target = _regist("#{type}@#{id}", &block)
target = _register("#{type}@#{id}", &block)
end
@grammar.intern(target)
end

def _regist(target_name)
def _register(target_name)
target = target_name.intern
unless _added?(@grammar.intern(target))
yield(target).each_rule do |rule|
Expand Down
4 changes: 2 additions & 2 deletions lib/racc/grammarfileparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ def parse_user_code
_, *blocks = *@scanner.epilogue.split(/^----/)
blocks.each do |block|
header, *body = block.lines.to_a
label0, pathes = *header.sub(/\A-+/, '').split('=', 2)
label0, paths = *header.sub(/\A-+/, '').split('=', 2)
label = canonical_label(label0)
(pathes ? pathes.strip.split(' ') : []).each do |path|
(paths ? paths.strip.split(' ') : []).each do |path|
add_user_code label, SourceText.new(File.read(path), path, 1)
end
add_user_code label, SourceText.new(body.join(''), @filename, line + 1)
Expand Down

0 comments on commit 78cf52e

Please sign in to comment.