show labels correctly
This commit is contained in:
parent
ccf3a37003
commit
6bbbef235c
@ -31,13 +31,19 @@ class RefView < ListView
|
||||
end
|
||||
|
||||
def is_object?( )
|
||||
Register.machine.objects[@value] != nil
|
||||
has = Register.machine.objects[@value]
|
||||
return false unless has
|
||||
! is_label?
|
||||
end
|
||||
|
||||
def is_string?()
|
||||
Register.machine.objects[@value].is_a? String
|
||||
end
|
||||
|
||||
def is_label?
|
||||
Register.machine.objects[@value].is_a?(Register::Label)
|
||||
end
|
||||
|
||||
def is_nil?()
|
||||
Register.machine.objects[@value].nil?
|
||||
end
|
||||
@ -55,6 +61,8 @@ class RefView < ListView
|
||||
var = Register.machine.objects[id]
|
||||
str = var.class.name.split("::").last[0,2]
|
||||
str + " : #{id.to_s}"
|
||||
elsif is_label?
|
||||
str = "Label"
|
||||
else
|
||||
str = @value.to_s
|
||||
end
|
||||
|
@ -24,8 +24,13 @@ class RegistersView < ListView
|
||||
def register_changed reg , old , value
|
||||
reg = reg.symbol unless reg.is_a? Symbol
|
||||
index = reg.to_s[1 .. -1 ].to_i
|
||||
if( is_object? value )
|
||||
has = Register.machine.objects[value]
|
||||
if( has )
|
||||
if has.is_a?(Register::Label)
|
||||
swap = ValueView.new "Label: #{has.name}"
|
||||
else
|
||||
swap = ObjectView.new( value , @interpreter , 16 - index )
|
||||
end
|
||||
else
|
||||
swap = ValueView.new value
|
||||
end
|
||||
@ -34,7 +39,9 @@ class RegistersView < ListView
|
||||
end
|
||||
|
||||
def is_object?( id )
|
||||
Register.machine.objects[id] != nil
|
||||
has = Register.machine.objects[id]
|
||||
return false unless has
|
||||
has.is_a?(Register::Label) ? false : true
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user