unite the two resolve_to_index functions

This commit is contained in:
Torsten Ruger
2018-04-05 20:10:00 +03:00
parent f4ce6d6253
commit f09086e524
11 changed files with 105 additions and 46 deletions

View File

@ -0,0 +1,15 @@
module Risc
module Assertions
def assert_slot_to_reg( slot , array = nil, index = nil , register = nil)
assert_equal SlotToReg , slot.class
assert_equal( array , slot.array.symbol) if array
assert_equal( index , slot.index) if index
assert_equal( register , slot.register.symbol) if register
end
def assert_load(load , clazz = nil , register = nil)
assert_equal LoadConstant , load.class
assert_equal( clazz , load.constant.class) if clazz
assert_equal( register , load.register.symbol) if register
end
end
end