passing the interpreter around

This commit is contained in:
Torsten Ruger 2015-07-23 20:08:40 +03:00
parent 53d576ef90
commit a896702880
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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