From b8e309b701931a4c9c1d5de6d1d3247642adbbad Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 21 Oct 2015 14:03:56 +0300 Subject: [PATCH] don't pre-start interpreter anymore, but allow for switching source --- lib/debugger.rb | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/debugger.rb b/lib/debugger.rb index 9b8fce5..d73d79a 100644 --- a/lib/debugger.rb +++ b/lib/debugger.rb @@ -4,6 +4,7 @@ require "opal-parser" require 'browser' +require 'browser/http' require 'native' require "salama" require "salama-reader" @@ -12,7 +13,7 @@ require "interpreter/interpreter" # the base, our own litle framework, allows for child and parent views and handles updates require "base/list_view" # each seperate view is in it's own class. -require "views/classes_view" +require "views/switch_view" require "views/status_view" require "views/file_view" require "views/blocks_view" @@ -24,20 +25,12 @@ class MainView < ListView def initialize machine = Virtual.machine.boot - - # 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 - - Phisol::Compiler.compile( CODE ) - + code = s(:statements, s(:class, :Foo, s(:derives, nil), + s(:statements, s(:class_field, :Integer, :x)))) + Phisol::Compiler.compile( code ) machine.collect @interpreter = Interpreter::Interpreter.new - @interpreter.start machine.init - super( [ClassesView.new(@interpreter) , + super( [SwitchView.new(@interpreter) , FileView.new , BlocksView.new(@interpreter) , InstructionView.new(@interpreter) ,