showing actual block and actual instruction
time to ponder a little more
This commit is contained in:
parent
1f19a28906
commit
53d576ef90
@ -1,16 +1,23 @@
|
||||
|
||||
require "source_view"
|
||||
|
||||
class BlockView
|
||||
|
||||
include React::Component
|
||||
required_param :block, type: []
|
||||
required_param :block, type: Virtual::Block
|
||||
|
||||
define_state :source
|
||||
|
||||
def render
|
||||
div :class => :row do
|
||||
block.each do |code| #should be block.codes.each
|
||||
div.row do
|
||||
div.col_md_6 do
|
||||
SourceView :source => block.codes.first.source
|
||||
end
|
||||
div.col_md_6 do
|
||||
block.codes.each do |code| #should be block.codes.each
|
||||
code.to_s.br
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -5,6 +5,11 @@ class Debugger
|
||||
required_param :machine , :type => Virtual::Machine
|
||||
define_state :interpreter => Interpreter.new
|
||||
|
||||
before_mount do
|
||||
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"
|
||||
end
|
||||
def render
|
||||
div.container do
|
||||
div.row do
|
||||
@ -16,11 +21,8 @@ class Debugger
|
||||
div.col_md_4 do
|
||||
"Future one"
|
||||
end
|
||||
div.col_md_4 do
|
||||
"Future two"
|
||||
end
|
||||
div.col_md_4 do
|
||||
BlockView block: [ "block 1" , "block 2"]
|
||||
div.col_md_8 do
|
||||
BlockView block: machine.init
|
||||
end
|
||||
end
|
||||
RegisterView registers: interpreter.registers
|
||||
|
@ -17,8 +17,4 @@ require 'opal-jquery'
|
||||
Document.ready? do # Document.ready? is a opal-jquery method.
|
||||
machine = Virtual.machine.boot
|
||||
React.render( React.create_element( Debugger , :machine => machine ), Element['#content'] )
|
||||
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"
|
||||
|
||||
end
|
||||
|
@ -2,10 +2,10 @@ class SourceView
|
||||
|
||||
include React::Component
|
||||
|
||||
define_state :source
|
||||
required_param :source, type: Virtual::Instruction
|
||||
|
||||
def render
|
||||
div :class => :row do
|
||||
div.row do
|
||||
"Virtual Machine Instruction".span
|
||||
source
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user