more fragment tests

This commit is contained in:
Torsten Ruger
2015-07-19 13:31:13 +03:00
parent 31d825df7b
commit d7c9245bb3
7 changed files with 22 additions and 48 deletions

View File

@ -37,8 +37,8 @@ module Virtual
to
end
def self.compile_module expression , method
clazz = Space.space.get_class_by_name name
def self.compile_modulename expression , method
clazz = Parfait::Space.object_space.get_class_by_name expression.name
raise "uups #{clazz}.#{name}" unless clazz
to = Return.new(Reference , clazz )
method.source.add_code Set.new( clazz , to )

View File

@ -7,10 +7,10 @@ module Virtual
p.name
end
if expression.receiver
#Do something clever instead of
# compiler will always return slot. with known value or not
r = Compiler.compile(expression.receiver, method )
if( r.is_a? Parfait::Class )
class_name = r.name
if( r.value.is_a? Parfait::Class )
class_name = r.value.name
else
raise "unimplemented #{r}"
end

View File

@ -7,7 +7,7 @@ module Virtual
def self.compile_class expression , method
clazz = Parfait::Space.object_space.get_class_by_name! expression.name
puts "Created class #{clazz.name.inspect}"
puts "Compiling class #{clazz.name.inspect}"
expression_value = nil
expression.expressions.each do |expr|
# check if it's a function definition and add