2017-01-14 18:28:44 +01:00
|
|
|
module Vm
|
2016-12-09 12:38:07 +01:00
|
|
|
module Tree
|
|
|
|
class IfStatement < Statement
|
|
|
|
attr_accessor :branch_type , :condition , :if_true , :if_false
|
2016-12-23 20:31:31 +01:00
|
|
|
def to_s
|
|
|
|
str = "if_#{branch_type}(#{condition}) \n #{if_true}\n"
|
|
|
|
str += "else\n #{if_false}\n" if if_false
|
|
|
|
str + "end\n"
|
|
|
|
end
|
2016-12-09 12:38:07 +01:00
|
|
|
end
|
2016-12-08 18:38:50 +01:00
|
|
|
end
|
|
|
|
end
|