diff --git a/app/block_view.rb b/app/block_view.rb index 0aa78a9..ba89dbb 100644 --- a/app/block_view.rb +++ b/app/block_view.rb @@ -4,17 +4,16 @@ require "source_view" class BlockView include React::Component - required_param :block, type: Virtual::Block + required_param :interpreter - define_state :source def render div.row do div.col_md_6 do - SourceView :source => block.codes.first.source + SourceView :source => interpreter.block.codes.first.source end div.col_md_6 do - block.codes.each do |code| #should be block.codes.each + interpreter.block.codes.each do |code| code.to_s.br end end diff --git a/app/debugger.rb b/app/debugger.rb index 1faae78..0a72284 100644 --- a/app/debugger.rb +++ b/app/debugger.rb @@ -9,6 +9,7 @@ class Debugger code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))]) Virtual::Compiler.compile( code , machine.space.get_main ) machine.run_before "Register::CallImplementation" + interpreter.start machine.init end def render div.container do @@ -22,10 +23,10 @@ class Debugger "Future one" end div.col_md_8 do - BlockView block: machine.init + BlockView interpreter: interpreter end end - RegisterView registers: interpreter.registers + RegisterView interpreter: interpreter end end end diff --git a/app/register_view.rb b/app/register_view.rb index a6449d7..d72c389 100644 --- a/app/register_view.rb +++ b/app/register_view.rb @@ -1,11 +1,11 @@ class RegisterView include React::Component - required_param :registers, type: {} + required_param :interpreter def render div :class => :row do - registers.each do |r , has| + interpreter.registers.each do |r , has| div :class => "col-md-1" do "#{r} : #{has}" end