adds self to sends args
This commit is contained in:
parent
4d725ea1ae
commit
3a152c1295
@ -38,7 +38,7 @@ module Ast
|
|||||||
if method.has_var(name)
|
if method.has_var(name)
|
||||||
frame.compile_get(method , name )
|
frame.compile_get(method , name )
|
||||||
else
|
else
|
||||||
frame.compile_send( method , name )
|
frame.compile_send( method , name , Virtual::Self.new( Virtual::Mystery.new ) )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,9 +6,8 @@ module Ast
|
|||||||
@@counter = 0
|
@@counter = 0
|
||||||
def compile frame , method
|
def compile frame , method
|
||||||
me = receiver.compile(frame , method )
|
me = receiver.compile(frame , method )
|
||||||
method.add Virtual::LoadSelf.new(me)
|
|
||||||
with = args.collect{|a| a.compile(frame , method)}
|
with = args.collect{|a| a.compile(frame , method)}
|
||||||
frame.compile_send( method , name , with )
|
frame.compile_send( method , name , me , with )
|
||||||
end
|
end
|
||||||
|
|
||||||
def scratch
|
def scratch
|
||||||
|
@ -33,7 +33,8 @@ module Virtual
|
|||||||
method.get_var(name)
|
method.get_var(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def compile_send method , name , with = []
|
def compile_send method , name , me , with = []
|
||||||
|
method.add Virtual::LoadSelf.new(me)
|
||||||
method.add FrameSend.new(name , with )
|
method.add FrameSend.new(name , with )
|
||||||
Return.new( method.return_type )
|
Return.new( method.return_type )
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user