debugging missing layout
This commit is contained in:
@ -15,6 +15,10 @@
|
||||
module Parfait
|
||||
class List < Object
|
||||
|
||||
def initialize( )
|
||||
super()
|
||||
end
|
||||
|
||||
def get_length
|
||||
internal_object_length - 1
|
||||
end
|
||||
|
@ -43,6 +43,10 @@ module Parfait
|
||||
method
|
||||
end
|
||||
|
||||
def remove_instance_method method
|
||||
@instance_methods.delete method
|
||||
end
|
||||
|
||||
def create_instance_method name , arg_names
|
||||
clazz = Space.object_space.get_class_by_name(self.name)
|
||||
raise "??? #{self.name}" unless clazz
|
||||
|
@ -43,17 +43,20 @@ module Parfait
|
||||
|
||||
# private
|
||||
def set_layout(layout)
|
||||
if( internal_object_get(LAYOUT_INDEX) )
|
||||
#if( was = internal_object_get(LAYOUT_INDEX) )
|
||||
#TODO find out wat these objects are
|
||||
# puts "Layout was set for #{self.class}"
|
||||
return
|
||||
end
|
||||
#puts "Layout was set for #{self.class}"
|
||||
#puts "#{self}" if self.class == Parfait::Word
|
||||
# Space.object_space.check was
|
||||
# return
|
||||
#end
|
||||
raise "Nil layout" unless layout
|
||||
internal_object_set(LAYOUT_INDEX , layout)
|
||||
end
|
||||
|
||||
def get_layout()
|
||||
l = internal_object_get(LAYOUT_INDEX)
|
||||
raise "No layout #{self.class}" unless l
|
||||
raise "No layout #{self.class}:#{self.to_s} #{self.object_id}" unless l
|
||||
return l
|
||||
end
|
||||
|
||||
|
@ -50,6 +50,25 @@ module Parfait
|
||||
@next_frame = @frames.first
|
||||
end
|
||||
|
||||
# double check that all objects dependents are really in the space too (debugging)
|
||||
def double_check
|
||||
@objects.each do |o|
|
||||
check o
|
||||
end
|
||||
end
|
||||
# private
|
||||
def check object , recurse = true
|
||||
raise "No good #{self.class}" unless @objects.include? object
|
||||
puts "#{object.class}"
|
||||
puts "#{object}" if object.class == Parfait::Word
|
||||
check object.get_layout
|
||||
return unless recurse
|
||||
object.get_layout.each do |name|
|
||||
check name , false
|
||||
inst = object.instance_variable_get "@#{name}".to_sym
|
||||
check inst , false
|
||||
end
|
||||
end
|
||||
@@object_space = nil
|
||||
# Make the object space globally available
|
||||
def self.object_space
|
||||
|
Reference in New Issue
Block a user