rubyx/lib/vm/tree/while_statement.rb

12 lines
262 B
Ruby
Raw Normal View History

2017-01-14 19:28:44 +02:00
module Vm
module Tree
class WhileStatement < Statement
attr_accessor :branch_type , :condition , :statements
2016-12-23 21:31:31 +02:00
def to_s
str = "while_#{branch_type}(#{condition}) do\n"
2016-12-28 14:11:05 +02:00
str + statements.to_s + "\nend\n"
2016-12-23 21:31:31 +02:00
end
end
end
end