fix fibo with new syntax. certainly works for operators, but not everything
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user