showing integers correctly
This commit is contained in:
parent
a8a233705d
commit
18cb04240d
@ -36,7 +36,7 @@ GIT
|
|||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/salama/salama.git
|
remote: git://github.com/salama/salama.git
|
||||||
revision: fdc7f8b39ce560506cd039805ccdb499cc4b31fa
|
revision: bb908dcf76b4497078afb5aa57a4d5643abfc4e6
|
||||||
specs:
|
specs:
|
||||||
salama (0.3.0)
|
salama (0.3.0)
|
||||||
salama-object-file (~> 0.3)
|
salama-object-file (~> 0.3)
|
||||||
|
@ -20,8 +20,7 @@ class ObjectView < ListView
|
|||||||
end
|
end
|
||||||
|
|
||||||
def object_changed reg , at
|
def object_changed reg , at
|
||||||
at = at - 1 #take the layout off
|
puts "Object changed in #{reg} , at #{at}"
|
||||||
#puts "Object changed in #{reg}"
|
|
||||||
for_object = @interpreter.get_register( reg )
|
for_object = @interpreter.get_register( reg )
|
||||||
return unless for_object == @object_id
|
return unless for_object == @object_id
|
||||||
#puts "Object changed #{for_object} , at #{at}"
|
#puts "Object changed #{for_object} , at #{at}"
|
||||||
@ -31,14 +30,13 @@ class ObjectView < ListView
|
|||||||
if(variable)
|
if(variable)
|
||||||
f = object.get_instance_variable(variable)
|
f = object.get_instance_variable(variable)
|
||||||
else
|
else
|
||||||
at += 1 # add layout back
|
variable = (at - object.class.get_length_index).to_s
|
||||||
variable = at.to_s
|
|
||||||
f = object.internal_object_get(at)
|
f = object.internal_object_get(at)
|
||||||
end
|
end
|
||||||
#puts "got var name #{variable}#{variable.class} for #{at}, #{f}"
|
#puts "got var name #{variable}#{variable.class} for #{at}, #{f}"
|
||||||
view = RefView.new( variable , f.object_id , @z )
|
view = RefView.new( variable , oid(f) , @z )
|
||||||
if( @children[at] )
|
if( @children[at-1] )
|
||||||
replace_at(at , view)
|
replace_at(at-1 , view)
|
||||||
else
|
else
|
||||||
append_view(view)
|
append_view(view)
|
||||||
end
|
end
|
||||||
@ -54,15 +52,15 @@ class ObjectView < ListView
|
|||||||
object = Register.machine.objects[@object_id]
|
object = Register.machine.objects[@object_id]
|
||||||
fields = []
|
fields = []
|
||||||
if object and ! object.is_a?(String)
|
if object and ! object.is_a?(String)
|
||||||
fields << RefView.new( "layout" , object.get_layout.object_id , @z )
|
|
||||||
object.get_instance_variables.each do |variable|
|
object.get_instance_variables.each do |variable|
|
||||||
f = object.get_instance_variable(variable)
|
f = object.get_instance_variable(variable)
|
||||||
fields << RefView.new( variable , f.object_id , @z )
|
fields << RefView.new( variable , oid(f) , @z )
|
||||||
end
|
end
|
||||||
if( object.is_a?(Parfait::List) )
|
if( object.is_a?(Parfait::Indexed) )
|
||||||
index = 1
|
index = 1
|
||||||
object.each do | o , i|
|
object.each do | o|
|
||||||
fields << RefView.new( index.to_s , o.object_id , @z )
|
puts "gett #{o}"
|
||||||
|
fields << RefView.new( index.to_s , oid(o) , @z )
|
||||||
index += 1
|
index += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -70,4 +68,8 @@ class ObjectView < ListView
|
|||||||
fields
|
fields
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def oid o
|
||||||
|
return o if o.is_a? Fixnum
|
||||||
|
return o.object_id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,12 +47,12 @@ class RefView < ListView
|
|||||||
def marker id
|
def marker id
|
||||||
if is_string?
|
if is_string?
|
||||||
str = @value
|
str = @value
|
||||||
elsif is_nil?
|
elsif is_object?
|
||||||
str = "nil"
|
|
||||||
else
|
|
||||||
var = Register.machine.objects[id]
|
var = Register.machine.objects[id]
|
||||||
str = var.class.name.split("::").last[0,2]
|
str = var.class.name.split("::").last[0,2]
|
||||||
str + " : #{id.to_s}"
|
str + " : #{id.to_s}"
|
||||||
|
else
|
||||||
|
str = @value.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user