add some explanation and use github gem versions
This commit is contained in:
@ -13,8 +13,17 @@ class MainView < ListView
|
||||
|
||||
def initialize
|
||||
machine = Virtual.machine.boot
|
||||
code = Ast::OperatorExpression.new("+", Ast::IntegerExpression.new(2),Ast::IntegerExpression.new(5))
|
||||
Virtual::Compiler.compile( code , machine.space.get_main )
|
||||
|
||||
# compile_main includes the parse
|
||||
# parsing generates an ast as seen below and then compiles it.
|
||||
machine.compile_main "2 + 5"
|
||||
|
||||
# so the code above is functionally equivalent to the one below, minus the parse
|
||||
# When the ast expression is given all works, so pretty sure it is the parse that fails
|
||||
|
||||
# code = Ast::OperatorExpression.new("+", Ast::IntegerExpression.new(2),Ast::IntegerExpression.new(5))
|
||||
# Virtual::Compiler.compile( code , machine.space.get_main )
|
||||
|
||||
machine.run_before "Register::CallImplementation"
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@parent = $document.body
|
||||
@ -25,7 +34,7 @@ class MainView < ListView
|
||||
def draw
|
||||
node = DOM {
|
||||
div.info {
|
||||
span.red "I'm all cooked up."
|
||||
span.red "Ready to start."
|
||||
}
|
||||
}
|
||||
node.append_to(@parent)
|
||||
|
Reference in New Issue
Block a user