and another one, and another one....

This commit is contained in:
Torsten Ruger
2014-07-13 16:00:48 +03:00
parent ae21863245
commit c1f475070b
5 changed files with 15 additions and 10 deletions

View File

@ -24,12 +24,12 @@ module Virtual
attr_reader :next_normal, :next_exception, :me, :binding
#
def compile_get name , method
def compile_get method , name
method.add FrameGet.new(name)
end
def compile_send name , method
method.add FrameSend.new(name)
def compile_send method , name , with = []
method.add FrameSend.new(name , with )
end
end
end

View File

@ -36,16 +36,17 @@ module Virtual
class FrameSend < Instruction
def initialize name
def initialize name , args = []
@name = name.to_sym
@args = args
end
attr_reader :name
attr_reader :name , :args
def == other
self.class == other.class && self.name == other.name
end
def inspect
self.class.name + ".new(:#{@name})"
self.class.name + ".new(:#{@name} , [ " + args.collect{|a| a.inspect}.join(",")+ "])"
end
end