diff --git a/assets/css/app.css.scss b/assets/css/app.css.scss index 328098d..0939a03 100644 --- a/assets/css/app.css.scss +++ b/assets/css/app.css.scss @@ -18,7 +18,7 @@ $susy: ( } .source_view { - @include span(4); + @include span(7); margin-left: span(1); } diff --git a/lib/debugger.rb b/lib/debugger.rb index b70bd6f..84617f2 100644 --- a/lib/debugger.rb +++ b/lib/debugger.rb @@ -16,7 +16,6 @@ require "base/list_view" require "views/switch_view" require "views/status_view" require "views/source_view" -require "views/blocks_view" require "views/instruction_view" require "views/registers_view" @@ -32,7 +31,6 @@ class MainView < ListView @interpreter = Interpreter::Interpreter.new super( [SwitchView.new(@interpreter) , SourceView.new(@interpreter) , - BlocksView.new(@interpreter) , InstructionView.new(@interpreter) , StatusView.new(@interpreter) , RegistersView.new(@interpreter) ] ) diff --git a/lib/views/blocks_view.rb b/lib/views/blocks_view.rb deleted file mode 100644 index 832855e..0000000 --- a/lib/views/blocks_view.rb +++ /dev/null @@ -1,52 +0,0 @@ - -class BlocksView < ListView - - def initialize interpreter - @interpreter = interpreter - @interpreter.register_event(:instruction_changed, self) - @interpreter.register_event(:state_changed, self) - show = [] - show << LabelView.new(@interpreter.instruction) if @interpreter.instruction.is_a?(Register::Label) - super(show) - end - - def draw - super() - wrap_element div("div.labels_view") << div("h4" , "Method + Block " ) << div("h4.method" , @method_name) - return @element - end - - def instruction_changed - return unless @interpreter.instruction.is_a?(Register::Label) - if @children.last - return if @interpreter.instruction.object_id == @children.last.label.object_id - @elements.last.at_css(".bright").remove_class("bright") - end - append_view( LabelView.new(@interpreter.instruction) ) - remove_first if( @elements.length > 6) - end - - def state_changed old , new_s - return unless new_s == :running - clear_view - end - -end - -class LabelView < ElementView - - def initialize label - @label = label - end - attr_reader :label - - def draw - @element = div("div") << div("span.bright" , label_name ) - end - - def label_name - return @label if @label.is_a? String - @label.name - end - -end diff --git a/lib/views/source_view.rb b/lib/views/source_view.rb index 57f3631..e6b6a63 100644 --- a/lib/views/source_view.rb +++ b/lib/views/source_view.rb @@ -8,13 +8,16 @@ class SourceView < ElementView def draw @text = div @ticker = div - @element = div(".source_view") << div("h4" ,"Future") << @ticker << @text + @element = div(".source_view") << div("h4.source" , "Class.Method") << @ticker << @text @element end def instruction_changed i = @interpreter.instruction return "" unless i + if( i.is_a?(Register::Label) and i.name.include?(".")) + @element.at_css(".source").text = i.name + end case i.source when AST::Node update_code