and another one, and another one....
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user