rubyx/lib/vm/tree/while_statement.rb

12 lines
262 B
Ruby
Raw Normal View History

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