fix all tests again

This commit is contained in:
Torsten Ruger
2015-05-13 12:15:14 +03:00
parent dd41758dea
commit f92e5cf475
6 changed files with 8 additions and 8 deletions

View File

@ -73,7 +73,7 @@ module Virtual
def self.compile_string expression , method
value = StringConstant.new(expression.string)
to = Return.new(Reference , value)
Space.space.add_object value
Machine.instance.space.add_object value
method.add_code Set.new( to , value )
to
end

View File

@ -8,8 +8,8 @@ module Virtual
end
r = expression.receiver ? Compiler.compile(expression.receiver, method ) : Self.new()
new_method = CompiledMethod.new(expression.name , args , r )
new_method.class_name = r.is_a?(BootClass) ? r.name : method.class_name
clazz = Space.space.get_or_create_class(new_method.class_name)
new_method.class_name = r.is_a?(Parfait::Class) ? r.name : method.class_name
clazz = Machine.instance.space.get_or_create_class(new_method.class_name)
clazz.add_instance_method new_method
#frame = frame.new_frame

View File

@ -117,7 +117,7 @@ module Virtual
[:get , :set , :puts].each do |f|
obj.add_instance_method Builtin::String.send(f , nil)
end
obj = get_or_create_class :Array
obj = space.get_or_create_class :Array
[:get , :set , :push].each do |f|
obj.add_instance_method Builtin::Array.send(f , nil)
end

View File

@ -26,7 +26,7 @@ module Virtual
else
# note: this is the current view: call internal send, even the method name says else
# but send is "special" and accesses the internal method name and resolves.
kernel = Virtual::Space.space.get_or_create_class(:Kernel)
kernel = Virtual::Machine.instance.space.get_or_create_class(:Kernel)
method = kernel.get_instance_method(:__send)
new_codes << MethodCall.new( method )
raise "unimplemented #{code}"