a lot of work to get one more test to pass
This commit is contained in:
@ -4,25 +4,25 @@ module Ast
|
||||
|
||||
class IntegerExpression < Expression
|
||||
# attr_reader :value
|
||||
def compile frame
|
||||
def compile frame , method
|
||||
Virtual::IntegerConstant.new value
|
||||
end
|
||||
end
|
||||
|
||||
class TrueExpression
|
||||
def compile frame
|
||||
def compile frame , method
|
||||
Virtual::TrueValue.new
|
||||
end
|
||||
end
|
||||
|
||||
class FalseExpression
|
||||
def compile frame
|
||||
def compile frame , method
|
||||
Virtual::FalseValue.new
|
||||
end
|
||||
end
|
||||
|
||||
class NilExpression
|
||||
def compile frame
|
||||
def compile frame , method
|
||||
Virtual::NilValue.new
|
||||
end
|
||||
end
|
||||
@ -44,7 +44,7 @@ module Ast
|
||||
|
||||
class ModuleName < NameExpression
|
||||
|
||||
def compile context
|
||||
def compile frame , method
|
||||
clazz = context.object_space.get_or_create_class name
|
||||
raise "uups #{clazz}.#{name}" unless clazz
|
||||
#class qualifier, means call from metaclass
|
||||
@ -56,9 +56,9 @@ module Ast
|
||||
|
||||
class StringExpression < Expression
|
||||
# attr_reader :string
|
||||
def compile context
|
||||
def compile frame , method
|
||||
value = Virtual::StringConstant.new(string)
|
||||
context.object_space.add_object value
|
||||
::Virtual::Object.space.add_object value
|
||||
value
|
||||
end
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ module Ast
|
||||
class CallSiteExpression < Expression
|
||||
# attr_reader :name, :args , :receiver
|
||||
@@counter = 0
|
||||
def compile context
|
||||
def compile frame , method
|
||||
into = context.function
|
||||
params = args.collect{ |a| a.compile(context) }
|
||||
puts "compiling receiver #{receiver} (call #{name})"
|
||||
|
Reference in New Issue
Block a user