fix super class with name mixup
This commit is contained in:
parent
37928b8591
commit
1d07c1fb95
@ -58,10 +58,12 @@ module Parfait
|
|||||||
# instantiated. By that logic it should maybe be part of vm rather.
|
# instantiated. By that logic it should maybe be part of vm rather.
|
||||||
# On the other hand vague plans to load the hierachy from sof exist, so for now...
|
# On the other hand vague plans to load the hierachy from sof exist, so for now...
|
||||||
def set_super_class_name sup
|
def set_super_class_name sup
|
||||||
|
raise "super_class_name must be a name, not #{sup}" unless sup.is_a?(Symbol)
|
||||||
self.super_class_name = sup
|
self.super_class_name = sup
|
||||||
end
|
end
|
||||||
|
|
||||||
def super_class
|
def super_class
|
||||||
|
puts "Superclass #{super_class_name}"
|
||||||
Parfait::Space.object_space.get_class_by_name(self.super_class_name)
|
Parfait::Space.object_space.get_class_by_name(self.super_class_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -75,18 +75,13 @@ module Register
|
|||||||
cl.name = name
|
cl.name = name
|
||||||
classes[name] = cl
|
classes[name] = cl
|
||||||
end
|
end
|
||||||
object_class = classes[:Object]
|
|
||||||
# superclasses other than default object
|
# superclasses other than default object
|
||||||
supers = { :Object => :Kernel , :Kernel => :Value, :Integer => :Value }
|
supers = { :Object => :Kernel , :Kernel => :Value, :Integer => :Value }
|
||||||
layout_names.each do |classname , ivar|
|
layout_names.each do |classname , ivar|
|
||||||
next if classname == :Value # has no superclass
|
next if classname == :Value # has no superclass
|
||||||
clazz = classes[classname]
|
clazz = classes[classname]
|
||||||
super_name = supers[classname]
|
super_name = supers[classname] || :Object
|
||||||
if super_name
|
clazz.set_super_class_name super_name
|
||||||
clazz.set_super_class_name classes[super_name]
|
|
||||||
else
|
|
||||||
clazz.set_super_class_name object_class
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user