block arg access was off by one
This commit is contained in:
parent
e1d5592c55
commit
1cb07a4164
@ -68,7 +68,17 @@ module Parfait
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
"#{class_name}-#{@names.inspect}"
|
str = "#{class_name}-["
|
||||||
|
first = false
|
||||||
|
@names.each do |name|
|
||||||
|
unless(first)
|
||||||
|
first = true
|
||||||
|
str += ":#{name}"
|
||||||
|
else
|
||||||
|
str += ", :#{name}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
str + "]"
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_names
|
def method_names
|
||||||
|
@ -66,7 +66,7 @@ module Risc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
s = "#{symbol}:#{type}"
|
s = "#{symbol}:#{type&.class_name}"
|
||||||
s += ":#{extra}" unless extra.empty?
|
s += ":#{extra}" unless extra.empty?
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
@ -64,7 +64,7 @@ module Vool
|
|||||||
# to call the block (that we know now to be the last arg),
|
# to call the block (that we know now to be the last arg),
|
||||||
# we do a message setup, arg transfer and the a arg_yield (which is similar to dynamic_call)
|
# we do a message setup, arg transfer and the a arg_yield (which is similar to dynamic_call)
|
||||||
def yield_arg_block(compiler)
|
def yield_arg_block(compiler)
|
||||||
arg_index = compiler.get_method.arguments_type.get_length
|
arg_index = compiler.get_method.arguments_type.get_length - 1
|
||||||
setup = Mom::MessageSetup.new( arg_index )
|
setup = Mom::MessageSetup.new( arg_index )
|
||||||
mom_receive = @receiver.slot_definition(compiler)
|
mom_receive = @receiver.slot_definition(compiler)
|
||||||
arg_target = [:message , :next_message , :arguments]
|
arg_target = [:message , :next_message , :arguments]
|
||||||
|
@ -35,7 +35,7 @@ module Vool
|
|||||||
end
|
end
|
||||||
def test_setup
|
def test_setup
|
||||||
assert_equal MessageSetup, @ins.next(2).class
|
assert_equal MessageSetup, @ins.next(2).class
|
||||||
assert_equal 3, @ins.next(2).method_source
|
assert_equal 2, @ins.next(2).method_source
|
||||||
end
|
end
|
||||||
def test_transfer
|
def test_transfer
|
||||||
assert_equal ArgumentTransfer, @ins.next(3).class
|
assert_equal ArgumentTransfer, @ins.next(3).class
|
||||||
@ -53,7 +53,7 @@ module Vool
|
|||||||
end
|
end
|
||||||
def test_yield
|
def test_yield
|
||||||
assert_equal BlockYield, @ins.next(4).class
|
assert_equal BlockYield, @ins.next(4).class
|
||||||
assert_equal 3, @ins.next(4).arg_index
|
assert_equal 2, @ins.next(4).arg_index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user