update salaam and boot parfait codes too

This commit is contained in:
Torsten Ruger
2015-11-09 00:02:23 +02:00
parent 10664ef090
commit 7c18ab3e36
2 changed files with 10 additions and 1 deletions

View File

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