ads to_s to ast for better readability

This commit is contained in:
Torsten Ruger
2014-05-13 10:49:26 +03:00
parent 140d33b167
commit dd05b30230
4 changed files with 19 additions and 3 deletions

View File

@@ -7,6 +7,9 @@ module Ast
def inspect
self.class.name + ".new(" + condition.inspect + ", " + body.inspect + " )"
end
def to_s
"while(#{condition}) do\n" + body.join("\n") + "\nend\n"
end
def attributes
[:condition, :body]
end