with the to_basic it actually compiles in the browser
also outputs the space using sof, just like in terminal opal really is a feat of engineering
This commit is contained in:
parent
1ebdf7f43c
commit
157981edf0
@ -5,6 +5,8 @@ if RUBY_PLATFORM == 'opal'
|
||||
require "main/lib/main_view"
|
||||
end
|
||||
|
||||
Virtual::Machine.boot
|
||||
|
||||
module Main
|
||||
class MainController < Volt::ModelController
|
||||
|
||||
@ -13,11 +15,16 @@ module Main
|
||||
end
|
||||
|
||||
def about
|
||||
promise = ParseTask.parse(1).then do |result|
|
||||
ParseTask.parse(1).then do |result|
|
||||
puts result
|
||||
is = Ast::Expression.from_basic(result)
|
||||
puts "back #{is.class}"
|
||||
Virtual::Compiler.compile( is , Virtual.machine.space.get_main )
|
||||
puts Virtual.machine.space.objects
|
||||
end.fail do |error|
|
||||
puts "Error: #{error}"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -6,6 +6,6 @@ class ParseTask < Volt::Task
|
||||
parser = Parser::Salama.new
|
||||
out = parser.parse(string_input)
|
||||
parts = Parser::Transform.new.apply(out)
|
||||
Sof.write parts
|
||||
parts.to_basic
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user