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)
|
||||
frame.compile_get(method , name )
|
||||
else
|
||||
frame.compile_send( method , name )
|
||||
frame.compile_send( method , name , Virtual::Self.new( Virtual::Mystery.new ) )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,9 +6,8 @@ module Ast
|
||||
@@counter = 0
|
||||
def compile frame , method
|
||||
me = receiver.compile(frame , method )
|
||||
method.add Virtual::LoadSelf.new(me)
|
||||
with = args.collect{|a| a.compile(frame , method)}
|
||||
frame.compile_send( method , name , with )
|
||||
frame.compile_send( method , name , me , with )
|
||||
end
|
||||
|
||||
def scratch
|
||||
|
@ -33,7 +33,8 @@ module Virtual
|
||||
method.get_var(name)
|
||||
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 )
|
||||
Return.new( method.return_type )
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user