salaam boots and classes are shown
This commit is contained in:
parent
264a52c184
commit
9383f0d75e
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
require "eventable"
|
require_relative "eventable"
|
||||||
|
|
||||||
class Interpreter
|
class Interpreter
|
||||||
# fire events for changed pc and register contents
|
# fire events for changed pc and register contents
|
@ -1,11 +1,12 @@
|
|||||||
# By default Volt generates this controller for your Main component
|
# By default Volt generates this controller for your Main component
|
||||||
|
require "salama"
|
||||||
|
require_relative "interpreter"
|
||||||
|
|
||||||
module Main
|
module Main
|
||||||
class MainController < Volt::ModelController
|
class MainController < Volt::ModelController
|
||||||
def index
|
def index
|
||||||
# code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))])
|
init_machine
|
||||||
# Virtual::Compiler.compile( code , machine.space.get_main )
|
init_classes
|
||||||
# machine.run_before "Register::CallImplementation"
|
|
||||||
# interpreter.start machine.init
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def about
|
def about
|
||||||
@ -13,7 +14,22 @@ module Main
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def init_machine
|
||||||
|
machine = Virtual.machine.boot
|
||||||
|
machine.run_before "Register::CallImplementation"
|
||||||
|
code = Ast::ExpressionList.new( [Ast::CallSiteExpression.new(:putstring, [] ,Ast::StringExpression.new("Hello again"))])
|
||||||
|
Virtual::Compiler.compile( code , machine.space.get_main )
|
||||||
|
@interpreter = Interpreter.new
|
||||||
|
@interpreter.start machine.init
|
||||||
|
end
|
||||||
|
def init_classes
|
||||||
|
page._classes!.clear
|
||||||
|
Virtual.machine.space.classes.each do |name , claz|
|
||||||
|
next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name
|
||||||
|
c = Volt::Model.new :name => name
|
||||||
|
page._classes << c
|
||||||
|
end
|
||||||
|
end
|
||||||
# The main template contains a #template binding that shows another
|
# The main template contains a #template binding that shows another
|
||||||
# template. This is the path to that template. It may change based
|
# template. This is the path to that template. It may change based
|
||||||
# on the params._component, params._controller, and params._action values.
|
# on the params._component, params._controller, and params._action values.
|
||||||
|
@ -2,8 +2,15 @@
|
|||||||
Home
|
Home
|
||||||
|
|
||||||
<:Body>
|
<:Body>
|
||||||
|
<div class="classes">
|
||||||
|
<h4> Classes </h4>
|
||||||
|
{{page._classes!.each do |clas| }}
|
||||||
|
<div class="one-class">
|
||||||
|
{{ clas._name }}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
ClassView classes: machine.space.classes
|
|
||||||
<div class="file-view">
|
<div class="file-view">
|
||||||
"Future Source code view"
|
"Future Source code view"
|
||||||
</div>
|
</div>
|
||||||
|
2
config/initializers/server/salama.rb
Normal file
2
config/initializers/server/salama.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Opal.use_gem "salama"
|
||||||
|
Opal.use_gem "salama-arm"
|
Loading…
x
Reference in New Issue
Block a user