move to soml ending, new while example

This commit is contained in:
Torsten Ruger 2015-11-04 16:12:37 +02:00
parent 04c7ab7fee
commit 65e5f39420
7 changed files with 24 additions and 4 deletions

View File

@ -93,7 +93,7 @@ The Register view is now greatly improved, especially in it's dynamic features:
The last feature of inspecting objects is show in the screenshot. This makes it possible The last feature of inspecting objects is show in the screenshot. This makes it possible
to very quickly verify the programs behaviour. As it is a pure object system , all data is in to very quickly verify the programs behaviour. As it is a pure object system , all data is in
objects, and all objects can be inspected. objects, and all objects can be inspected.
### Debugging the debugger ### Debugging the debugger
@ -107,3 +107,11 @@ usable and restarting a debug is fine.
## Todos ## Todos
Breakpoints would be nice at some point. Both in step count and variable value. Breakpoints would be nice at some point. Both in step count and variable value.
## Trying it out
Clone
Bundle
bundle exec rackup

12
codes/a_while.soml Normal file
View File

@ -0,0 +1,12 @@
class Object
int main()
int i = 5
while_plus(i)
"out".putstring()
i = i - 1
end
return i
end
end

View File

@ -22,11 +22,11 @@ class DebugServer < Opal::Server
end end
end end
def codes def codes
[Dir["codes/*.saml"].collect{|f| f.sub("codes/","").sub(".saml","")}.join("----")] [Dir["codes/*.soml"].collect{|f| f.sub("codes/","").sub(".soml","")}.join("----")]
end end
def code at def code at
saml = File.new("codes/#{at}.saml").read soml = File.new("codes/#{at}.soml").read
syntax = Parser::Salama.new.parse_with_debug(saml) syntax = Parser::Salama.new.parse_with_debug(soml)
parts = Parser::Transform.new.apply(syntax) parts = Parser::Transform.new.apply(syntax)
[parts.inspect] [parts.inspect]
end end