rubyx/test/support/fake_compiler.rb
Torsten Ruger b294208025 continue with #11
slots are the most tricky, especially testing
2018-08-19 13:06:00 +03:00

28 lines
509 B
Ruby

module Risc
class FakeCompiler
attr_reader :instructions
def initialize
@instructions = []
end
def add_code(c)
@instructions << c
end
def current
@instructions.last
end
def slot_type(slot,type)
type.type_for(slot)
end
def resolve_type(name)
Parfait.object_space.types.values.first
end
def use_reg(type , extra = {})
RegisterValue.new(:r1 , type)
end
def reset_regs
end
def add_constant(c)
end
end
end