fix fibo with new syntax. certainly works for operators, but not everything

This commit is contained in:
Torsten Ruger
2014-05-21 12:47:40 +03:00
parent 16a07d5aa2
commit e1f889fd10
5 changed files with 50 additions and 22 deletions

View File

@ -11,6 +11,10 @@ module Vm
# The first setting the position, the second assembling
class Code
def class_for clazz
CMachine.instance.class_for(clazz)
end
# set the position to zero, will have to reset later
def initialize
@position = 0

View File

@ -28,6 +28,18 @@ module Vm
def opcode
@attributes[:opcode]
end
def method_missing name , *args , &block
return super unless (args.length <= 1) or block_given?
set , attribute = name.to_s.split("set_")
if set == ""
@attributes[attribute.to_sym] = args[0] || 1
return self
else
return super
end
return @attributes[name.to_sym]
end
end
class StackInstruction < Instruction