add some explanation and use github gem versions

This commit is contained in:
Torsten Ruger
2015-08-20 16:13:57 +02:00
parent ef1235d3e8
commit 1f7c06d626
3 changed files with 55 additions and 35 deletions

View File

@ -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)