diff --git a/Gemfile.lock b/Gemfile.lock index 77ae9e9..0856338 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GIT GIT remote: git://github.com/salama/salama.git - revision: 64d99d5e68f2ad512210ae64b33d6f1c1eddc1ec + revision: b2de1c6d7911c16fa547d971ccbb106cf907cc2a specs: salama (0.3.0) salama-object-file (~> 0.3) diff --git a/config.ru b/config.ru index a91816e..e16ef5e 100644 --- a/config.ru +++ b/config.ru @@ -17,6 +17,8 @@ class DebugServer < Opal::Server route = path[1 .. path.index(".") - 1] if( route == "codes") [200, { 'Content-Type' => 'text/json' }, codes ] + elsif( route == "parfait") + [200, { 'Content-Type' => 'text/json' }, parfait ] else [200, { 'Content-Type' => 'text/json' }, code(route) ] end @@ -24,6 +26,13 @@ class DebugServer < Opal::Server def codes [Dir["codes/*.soml"].collect{|f| f.sub("codes/","").sub(".soml","")}.join("----")] end + def parfait + all = [] + Soml::Compiler.each_parfait do |part| + all << part + end + [all.inspect] + end def code at soml = File.new("codes/#{at}.soml").read syntax = Parser::Salama.new.parse_with_debug(soml)