Skip to content

Commit 6dea808

Browse files
committed
Fix build error
1 parent a908f9d commit 6dea808

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

lib/ruby/module.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def #{name}(*args, &block)
111111
optionals = []
112112

113113
triples = method.parameters.map do |k, n|
114-
n ||= new_names.succ! # Get a fresh name if needed
114+
n ||= (new_names.succ!).dup # Get a fresh name if needed
115+
115116
case k
116117
when :req then [n, n, n] # def foo(x)
117118
when :keyreq then [n, n, "#{n}:#{n}"] # def foo(x:)
@@ -177,12 +178,12 @@ def emit_call(receiver, name, arg_names, arguments, optionals, state)
177178
end
178179

179180
def emit_args(arg_names, arguments, optionals, state)
180-
arg_names.inject([]) do |args, name|
181+
arg_names.inject([]) do |xs, name|
181182
if k = optionals.index(name)
182-
args << arguments[name] if state[k].zero?
183+
xs << arguments[name] if state[k].zero?
183184
else
184-
args << arguments[name]
185-
end; args
185+
xs << arguments[name]
186+
end; xs
186187
end.join(", ")
187188
end
188189
end

lib/stupidedi/reader/pointer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ class StringPtr < Pointer
353353
# @group Conversion Methods
354354
#########################################################################
355355

356-
def_delegators :reify, :to_sym, :intern, :to_i, :to_d
356+
def_delegators :reify, :to_sym, :intern, :to_i, type: String
357+
def_delegators :reify, :to_d
357358

358359
# This is called implicitly when we are used in String interpolation,
359360
# eg `"abc #{pointer} xyz"` or `"abc %s xyz" % pointer`.

spec/support/fixtures.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
Fixtures = Class.new do
55

6-
Position = Struct.new(:name, :line, :column, :offset)
7-
Position.include(Stupidedi::Reader::Position)
8-
96
def versions
107
{ "006020" => "SixtyTwenty",
118
"005010" => "FiftyTen",
@@ -45,6 +42,10 @@ def read(path)
4542
File.open(File.join(@root, path), "rb", &:read)
4643
end
4744

45+
def position
46+
@position ||= Struct.new(:name, :line, :column, :offset).include(Stupidedi::Reader::Position)
47+
end
48+
4849
# @return [Stupidedi::Parser::StateMachine, Stupidedi::Reader::Result]
4950
def parse(path, config = nil)
5051
if path.is_a?(String)
@@ -55,7 +56,7 @@ def parse(path, config = nil)
5556
_, config, _ = mkconfig(*parts(path))
5657
end
5758

58-
tokenizer = Stupidedi::Reader.build(@root.join(path), Position)
59+
tokenizer = Stupidedi::Reader.build(@root.join(path), position: position)
5960
Stupidedi::Parser.build(config).read(tokenizer)
6061
end
6162

0 commit comments

Comments
 (0)