change to same file ending
This commit is contained in:
parent
17fb7fbf74
commit
a8a233705d
22
codes/a_times.saml
Normal file
22
codes/a_times.saml
Normal file
@ -0,0 +1,22 @@
|
||||
class Object
|
||||
|
||||
int times(int a, int b)
|
||||
if_zero( b )
|
||||
a = 0
|
||||
else
|
||||
int m = b - 1
|
||||
int t = times(a, m)
|
||||
a = a + t
|
||||
end
|
||||
return a
|
||||
end
|
||||
|
||||
int t_seven()
|
||||
int tim = times(5,3)
|
||||
tim.putint()
|
||||
end
|
||||
|
||||
int main()
|
||||
return t_seven()
|
||||
end
|
||||
end
|
@ -22,11 +22,11 @@ class DebugServer < Opal::Server
|
||||
end
|
||||
end
|
||||
def codes
|
||||
[Dir["codes/*.psol"].collect{|f| f.sub("codes/","").sub(".psol","")}.join("----")]
|
||||
[Dir["codes/*.saml"].collect{|f| f.sub("codes/","").sub(".saml","")}.join("----")]
|
||||
end
|
||||
def code at
|
||||
phisol = File.new("codes/#{at}.psol").read
|
||||
syntax = Parser::Salama.new.parse_with_debug(phisol)
|
||||
saml = File.new("codes/#{at}.saml").read
|
||||
syntax = Parser::Salama.new.parse_with_debug(saml)
|
||||
parts = Parser::Transform.new.apply(syntax)
|
||||
[parts.inspect]
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user