adds self to sends args

This commit is contained in:
Torsten Ruger 2014-07-15 18:34:03 +03:00
parent 4d725ea1ae
commit 3a152c1295
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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