fixes the tests after fixing hierarchy
This commit is contained in:
@ -34,7 +34,7 @@ module Ast
|
||||
# otherwise it's a method without args and a send is ussued.
|
||||
# this makes the namespace static, ie when eval and co are implemented method needs recompilation
|
||||
def compile frame , method
|
||||
return Virtual::SelfReference.new() if name == :self
|
||||
return Virtual::Self.new( Virtual::Mystery.new ) if name == :self
|
||||
if method.has_var(name)
|
||||
frame.compile_get(method , name )
|
||||
else
|
||||
@ -75,6 +75,7 @@ module Ast
|
||||
class VariableExpression < NameExpression
|
||||
def compile frame ,method
|
||||
method.add Virtual::ObjectGet.new(name)
|
||||
Virtual::Return.new( Virtual::Mystery.new )
|
||||
end
|
||||
end
|
||||
end
|
@ -6,7 +6,7 @@ module Ast
|
||||
@@counter = 0
|
||||
def compile frame , method
|
||||
with = args.collect{|a| a.compile(frame , method)}
|
||||
frame.compile_send( method , @name , with )
|
||||
frame.compile_send( method , name , with )
|
||||
end
|
||||
|
||||
def scratch
|
||||
|
@ -2,12 +2,10 @@ module Ast
|
||||
class OperatorExpression < Expression
|
||||
# attr_reader :operator, :left, :right
|
||||
def compile frame , method
|
||||
tmp = method.get_tmp
|
||||
ass = AssignmentExpression.new( tmp , left )
|
||||
l = ass.compile(frame , method)
|
||||
call = CallSiteExpression.new( operator , [right] , l)
|
||||
call = CallSiteExpression.new( operator , [right] , left )
|
||||
call.compile(frame , method)
|
||||
end
|
||||
|
||||
def scratch
|
||||
into = context.function
|
||||
puts "compiling operator #{to_s}"
|
||||
|
Reference in New Issue
Block a user