show source better

still wip
This commit is contained in:
Torsten Ruger 2018-04-06 13:03:39 +03:00
parent 4c342d064d
commit 509aff9552
4 changed files with 11 additions and 10 deletions

View File

@ -25,7 +25,7 @@ class DebugServer < Opal::Server
end end
end end
run Opal::Server.new { |s| run Opal::Sprockets::Server.new { |s|
s.main = 'debugger.js.rb' s.main = 'debugger.js.rb'
s.append_path 'lib' s.append_path 'lib'
s.append_path 'assets' s.append_path 'assets'

View File

@ -36,7 +36,8 @@ class InstructionView < ListView
def instruction_text def instruction_text
return "" unless @interpreter.instruction return "" unless @interpreter.instruction
@interpreter.instruction.to_s text = @interpreter.instruction.to_s
text.split("(").first
end end
end end

View File

@ -45,7 +45,7 @@ class ObjectView < ListView
end end
def content_elements def content_elements
fields = [ConstantView.new("li" , "----------------------------------")] fields = [ConstantView.new("li" , "---------------------------------")]
object = @object object = @object
if object and ! object.is_a?(String) if object and ! object.is_a?(String)
object.get_instance_variables.each do |variable| object.get_instance_variables.each do |variable|

View File

@ -20,13 +20,13 @@ class SourceView < ElementView
update_method update_method
case i.source case i.source
when Mom::Instruction when Mom::Instruction
id = i.source.object_id.to_s(16) @ticker.text = i.source.class.name
if e = @text.at_css("#i#{id}") # if e = @text.at_css("#i#{id}")
if (old = @text.at_css(".fade_in")) # if (old = @text.at_css(".fade_in"))
old.remove_class("fade_in") # old.remove_class("fade_in")
end # end
e.add_class "fade_in" # e.add_class "fade_in"
end # end
when String when String
@ticker.text = i.source @ticker.text = i.source
when Risc::Instruction when Risc::Instruction