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"
|
require "main/lib/main_view"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Virtual::Machine.boot
|
||||||
|
|
||||||
module Main
|
module Main
|
||||||
class MainController < Volt::ModelController
|
class MainController < Volt::ModelController
|
||||||
|
|
||||||
@ -13,11 +15,16 @@ module Main
|
|||||||
end
|
end
|
||||||
|
|
||||||
def about
|
def about
|
||||||
promise = ParseTask.parse(1).then do |result|
|
ParseTask.parse(1).then do |result|
|
||||||
puts 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|
|
end.fail do |error|
|
||||||
puts "Error: #{error}"
|
puts "Error: #{error}"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -6,6 +6,6 @@ class ParseTask < Volt::Task
|
|||||||
parser = Parser::Salama.new
|
parser = Parser::Salama.new
|
||||||
out = parser.parse(string_input)
|
out = parser.parse(string_input)
|
||||||
parts = Parser::Transform.new.apply(out)
|
parts = Parser::Transform.new.apply(out)
|
||||||
Sof.write parts
|
parts.to_basic
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user