ads to_s to ast for better readability
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user