start to add while loop
This commit is contained in:
16
lib/ast/while_expression.rb
Normal file
16
lib/ast/while_expression.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module Ast
|
||||
class WhileExpression < Expression
|
||||
attr_reader :condition, :body
|
||||
def initialize condition, body
|
||||
@condition , @body = condition , body
|
||||
end
|
||||
def inspect
|
||||
self.class.name + ".new(" + condition.inspect + ", " + body.inspect + " )"
|
||||
end
|
||||
def attributes
|
||||
[:condition, :body]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
Reference in New Issue
Block a user