change return sequence to return messages to space

as it was before blocks
(thought blocks would make reuse of messages impossible, but was wrong, this only appilies to lambdas)
(too) many tests affected
This commit is contained in:
Torsten Ruger
2018-08-06 14:07:17 +03:00
parent 77cbc0ad6a
commit 393ac873c9
31 changed files with 193 additions and 399 deletions

View File

@ -25,11 +25,13 @@ module Risc
LoadData, OperatorInstruction, LoadData, OperatorInstruction, OperatorInstruction,
LoadConstant, SlotToReg, SlotToReg, RegToSlot, Branch,
RegToSlot, RegToSlot, SlotToReg, SlotToReg, RegToSlot,
SlotToReg, SlotToReg, SlotToReg, FunctionReturn, SlotToReg,
SlotToReg, RegToSlot, SlotToReg, Branch, SlotToReg,
RegToSlot, Branch, SlotToReg, SlotToReg, RegToSlot,
SlotToReg, SlotToReg, SlotToReg, FunctionReturn, Transfer,
SlotToReg, SlotToReg, Branch, Syscall, NilClass]
LoadConstant, SlotToReg, RegToSlot, RegToSlot, SlotToReg,
SlotToReg, SlotToReg, FunctionReturn, SlotToReg, SlotToReg,
RegToSlot, SlotToReg, Branch, SlotToReg, RegToSlot,
Branch, SlotToReg, SlotToReg, RegToSlot, LoadConstant,
SlotToReg, RegToSlot, RegToSlot, SlotToReg, SlotToReg,
SlotToReg, Branch, FunctionReturn, Transfer, SlotToReg,
SlotToReg, Branch, Syscall, NilClass]
assert_equal 2 , get_return
end
@ -39,15 +41,10 @@ module Risc
assert_equal 25 , @interpreter.get_register(load_ins.register).value
end
def test_return_class
ret = main_ticks(74)
ret = main_ticks(78)
assert_equal FunctionReturn , ret.class
link = @interpreter.get_register( ret.register )
assert_equal Fixnum , link.class
end
def test_sys
sys = main_ticks(94)
assert_equal Syscall , sys.class
assert_equal :exit , sys.name
end
end
end