adjust program tests to new syntax, hello world works there too -)
This commit is contained in:
@ -30,7 +30,7 @@ module Arm
|
||||
@operand = op_with_rot
|
||||
@i = 1
|
||||
else
|
||||
raise "cannot fit numeric literal argument in operand #{arg}"
|
||||
raise "cannot fit numeric literal argument in operand #{arg.inspect}"
|
||||
end
|
||||
elsif (arg.is_a?(Symbol))
|
||||
@operand = arg
|
||||
|
@ -65,6 +65,16 @@ module Vm
|
||||
@next = block
|
||||
end
|
||||
|
||||
# sugar to create instructions easily. Any method with one arg is sent to the machine and the result
|
||||
# (hopefully an instruction) added as code
|
||||
def method_missing(meth, *args, &block)
|
||||
if args.length == 1
|
||||
add_code Machine.instance.send(meth , *args)
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -30,7 +30,7 @@ module Vm
|
||||
@functions = []
|
||||
@entry = Core::Kernel::main_start
|
||||
#main gets executed between entry and exit
|
||||
@main = nil
|
||||
@main = Block.new("main")
|
||||
@exit = Core::Kernel::main_exit
|
||||
end
|
||||
attr_reader :context , :main , :functions
|
||||
|
Reference in New Issue
Block a user