separate ticker for internal codes

This commit is contained in:
Torsten Ruger 2015-10-29 16:53:46 +02:00
parent 4bf8ac5345
commit b76fe1645e

View File

@ -7,22 +7,20 @@ class SourceView < ElementView
def draw def draw
@text = div @text = div
@element = div(".source_view") << div("h4" ,"Future") << @text @ticker = div
@element = div(".source_view") << div("h4" ,"Future") << @ticker << @text
@element @element
end end
def instruction_changed def instruction_changed
@text.text = source
end
def source
i = @interpreter.instruction i = @interpreter.instruction
return "" unless i return "" unless i
case i.source case i.source
when AST::Node when AST::Node
i.source.to_s @text.text = i.source.to_s
@ticker.text = ""
when String when String
"String " + i.source @ticker.text = i.source
else else
raise i.source.class.name raise i.source.class.name
end end