seperate args from message (just like frame)

This commit is contained in:
Torsten Ruger
2016-12-21 22:35:36 +02:00
parent ed12108425
commit c3c52d36b8
12 changed files with 46 additions and 70 deletions

View File

@ -16,7 +16,7 @@ module Ticker
# must be after boot, but before main compile, to define method
def do_clean_compile
end
def check_chain should
should.each_with_index do |name , index|
got = ticks(1)
@ -51,6 +51,7 @@ module Ticker
rescue => e
puts "Error at tick #{tick}"
puts e
puts e.backtrace
end
classes = classes.collect {|c| '"' + c.name.sub("Register::","") + '",' }
classes << "length = #{classes.length}"

View File

@ -32,7 +32,7 @@ HERE
s(:false_statements, s(:call, s(:name, :putstring), s(:arguments), s(:receiver, s(:string, "else"))))))
end
def test_if
#show_ticks # get output of what is
show_ticks # get output of what is
check_chain ["Branch","Label","LoadConstant","GetSlot","SetSlot",
"LoadConstant","SetSlot","FunctionCall","Label","GetSlot",
"GetSlot","SetSlot","LoadConstant","SetSlot","LoadConstant",

View File

@ -8,7 +8,6 @@ class TestMessage < MiniTest::Test
def test_length
assert_equal 9 , @mess.get_type.instance_length , @mess.get_type.inspect
assert_equal 9 , Parfait::Message.get_length_index
end
def test_attribute_set
@ -17,39 +16,7 @@ class TestMessage < MiniTest::Test
end
def test_indexed
assert_equal 9 , @mess.get_type.variable_index(:indexed_length)
end
def test_push1
@mess.push :name
assert_equal 1 , @mess.get_length
end
def test_push2
@mess.push :name
assert_equal 1 , @mess.indexed_length
end
def test_push3
@mess.push :name
assert_equal 1 , @mess.get_internal_word(9)
end
def test_get_internal_word
@mess.push :name
assert_equal :name , @mess.get_internal_word(10)
end
def test_get
index = @mess.push :name
assert_equal 1 , index
assert_equal :name , @mess.get(1)
end
def test_each
three = [:one,:two,:three]
three.each {|i| @mess.push(i)}
assert_equal 3 , @mess.get_length
@mess.each do |u|
assert_equal u , three.delete(u)
end
assert_equal 0 , three.length
assert_equal 9 , @mess.get_type.variable_index(:arguments)
end
end

View File

@ -79,7 +79,7 @@ class TestAssignStatement < MiniTest::Test
was = check
get = was.next(1)
assert_equal GetSlot , get.class
assert_equal 10, get.index , "Get to named_list index must be offset, not #{get.index}"
assert_equal 1, get.index , "Get to args index must be offset, not #{get.index}"
end
end
end