add block inspect, status: up to first jump
This commit is contained in:
parent
69414a11f9
commit
c22a4a95d3
2
Gemfile
2
Gemfile
@ -13,8 +13,6 @@ gem 'volt-bootstrap', '~> 0.0.10'
|
|||||||
gem 'csso-rails', '~> 0.3.4', require: false
|
gem 'csso-rails', '~> 0.3.4', require: false
|
||||||
gem 'uglifier', '>= 2.4.0', require: false
|
gem 'uglifier', '>= 2.4.0', require: false
|
||||||
|
|
||||||
#gem "salama" , "0.2" , :path => "../salama"
|
|
||||||
|
|
||||||
gem "parslet" , path: "../parslet"
|
gem "parslet" , path: "../parslet"
|
||||||
gem "salama" , path: "../salama"
|
gem "salama" , path: "../salama"
|
||||||
gem "salama-reader" , path: "../salama-reader"
|
gem "salama-reader" , path: "../salama-reader"
|
||||||
|
@ -11,7 +11,7 @@ module Main
|
|||||||
page._registers!.clear
|
page._registers!.clear
|
||||||
page._classes!.clear
|
page._classes!.clear
|
||||||
page._objects!.clear
|
page._objects!.clear
|
||||||
|
page._block = BlockModel.new nil
|
||||||
fill_regs
|
fill_regs
|
||||||
parse_and_fill
|
parse_and_fill
|
||||||
end
|
end
|
||||||
@ -26,11 +26,7 @@ module Main
|
|||||||
ParseTask.parse(1).then do |result|
|
ParseTask.parse(1).then do |result|
|
||||||
is = Ast::Expression.from_basic(result)
|
is = Ast::Expression.from_basic(result)
|
||||||
Virtual::Compiler.compile( is , Virtual.machine.space.get_main )
|
Virtual::Compiler.compile( is , Virtual.machine.space.get_main )
|
||||||
begin
|
Virtual.machine.run_before "Register::CallImplementation"
|
||||||
Virtual.machine.run_before Virtual::Machine::FIRST_PASS
|
|
||||||
rescue => e
|
|
||||||
puts "FILL #{e}"
|
|
||||||
end
|
|
||||||
fill_classes
|
fill_classes
|
||||||
end.fail do |error|
|
end.fail do |error|
|
||||||
raise "Error: #{error}"
|
raise "Error: #{error}"
|
||||||
@ -42,6 +38,7 @@ module Main
|
|||||||
c = Volt::Model.new :name => name
|
c = Volt::Model.new :name => name
|
||||||
page._classes << c
|
page._classes << c
|
||||||
end
|
end
|
||||||
|
page._block = BlockModel.new Virtual.machine.init
|
||||||
end
|
end
|
||||||
def fill_regs
|
def fill_regs
|
||||||
register_names = (0..8).collect {|i| "r#{i}"}
|
register_names = (0..8).collect {|i| "r#{i}"}
|
||||||
|
13
app/main/models/block_model.rb
Normal file
13
app/main/models/block_model.rb
Normal 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
|
@ -10,8 +10,23 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<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>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user