first interpreted instruction, with gui change
This commit is contained in:
parent
246bb5ee4f
commit
f5ece67233
@ -6,21 +6,26 @@ class BlockView
|
||||
include React::Component
|
||||
required_param :interpreter
|
||||
|
||||
define_state :block
|
||||
|
||||
before_mount do
|
||||
interpreter.register_event(event: :block_changed, listener: self, callback: :block_changed)
|
||||
interpreter.register_event(:block_changed, self)
|
||||
block! interpreter.block
|
||||
end
|
||||
|
||||
def block_changed block
|
||||
block! block
|
||||
def block_changed old , bl
|
||||
block! bl
|
||||
end
|
||||
|
||||
def render
|
||||
return unless block
|
||||
div.row do
|
||||
div.col_md_5 do
|
||||
SourceView :source => interpreter.block.codes.first.source
|
||||
SourceView :source => block.codes.first.source
|
||||
end
|
||||
div.col_md_5 do
|
||||
interpreter.block.codes.each do |code|
|
||||
h6 { "Block: #{block.name}"}
|
||||
block.codes.each do |code|
|
||||
code.to_s.br
|
||||
end
|
||||
end
|
||||
|
@ -6,8 +6,8 @@ class SourceView
|
||||
|
||||
def render
|
||||
div.row do
|
||||
"Virtual Machine Instruction".span
|
||||
source
|
||||
"Virtual Machine Instruction".br
|
||||
source.class.name
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,7 +36,8 @@ class Interpreter
|
||||
end
|
||||
|
||||
def execute_Branch
|
||||
target = @instruction.to
|
||||
target = @instruction.block
|
||||
set_block target
|
||||
false
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user