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