add block inspect, status: up to first jump

This commit is contained in:
Torsten Ruger 2015-07-17 15:14:41 +03:00
parent 69414a11f9
commit c22a4a95d3
4 changed files with 33 additions and 10 deletions

View File

@ -13,8 +13,6 @@ gem 'volt-bootstrap', '~> 0.0.10'
gem 'csso-rails', '~> 0.3.4', require: false
gem 'uglifier', '>= 2.4.0', require: false
#gem "salama" , "0.2" , :path => "../salama"
gem "parslet" , path: "../parslet"
gem "salama" , path: "../salama"
gem "salama-reader" , path: "../salama-reader"

View File

@ -11,7 +11,7 @@ module Main
page._registers!.clear
page._classes!.clear
page._objects!.clear
page._block = BlockModel.new nil
fill_regs
parse_and_fill
end
@ -26,11 +26,7 @@ module Main
ParseTask.parse(1).then do |result|
is = Ast::Expression.from_basic(result)
Virtual::Compiler.compile( is , Virtual.machine.space.get_main )
begin
Virtual.machine.run_before Virtual::Machine::FIRST_PASS
rescue => e
puts "FILL #{e}"
end
Virtual.machine.run_before "Register::CallImplementation"
fill_classes
end.fail do |error|
raise "Error: #{error}"
@ -42,6 +38,7 @@ module Main
c = Volt::Model.new :name => name
page._classes << c
end
page._block = BlockModel.new Virtual.machine.init
end
def fill_regs
register_names = (0..8).collect {|i| "r#{i}"}

View File

@ -0,0 +1,13 @@
# represent a block and hold the actual instance (as transient)
class BlockModel < Volt::Model
field :name
attr_accessor :block
def initialize(b)
super()
@block = b
self.name = b.nil? ? 'undefined' : b.name
end
end

View File

@ -10,8 +10,23 @@
{{ end }}
</div>
<div class="row">
<div class="col-md-1">
<div class="col-md-4">
Messages
</div>
<div class="col-md-4">
Source Code
</div>
<div class="col-md-4">
<div class="row">
Current block: {{ page._block._name}}
</div>
<div class="row">
{{ if page._block.block }}
{{ page._block.block.codes.each do |c| }}
{{ c.to_s }}
{{ end }}
{{ end }}
</div>
</div>
</div>
<div class="row">