allow reverse syntax for >> (ie <<)

slot >> reg makes sense, being a slot_to_reg
but . . .
consistently use of << (as meaning assignment , =) also makes sense
allow both and let time tell which makes more sense
This commit is contained in:
Torsten Ruger
2018-04-06 21:05:26 +03:00
parent 41d573d571
commit c042dd9faa
3 changed files with 9 additions and 2 deletions

View File

@ -35,6 +35,12 @@ module Risc
assert_equal SlotToReg , built.class
assert_equal :r1 , built.array.symbol
end
def test_returns_slot_reverse
r2 = RiscValue.new(:r2 , :Message)
built = @builder.build{ r2 << space[:first_message] }
assert_equal SlotToReg , built.class
assert_equal :r1 , built.array.symbol
end
def test_reuses_names
r1 = RiscValue.new(:r1 , :Space)
built = @builder.build{ space << r1 ; space << r1}