rubyx/lib/vool/statements/while_statement.rb

18 lines
385 B
Ruby
Raw Normal View History

2017-04-01 20:28:57 +02:00
module Vool
class WhileStatement < Statement
attr_reader :condition , :statements
2017-04-03 10:49:21 +02:00
def initialize( condition , statements )
2017-04-03 10:49:21 +02:00
@condition = condition
@statements = statements
simplify_condition
2017-04-03 10:49:21 +02:00
end
def simplify_condition
return unless @condition.is_a?(ScopeStatement)
@condition = @condition.first if @condition.single?
end
2017-04-01 20:28:57 +02:00
end
end