Ast::ForLoop
struct If < Expr property location : Location property condition : Cell(Expr) property then_branch : Cell(Expr) property else_branch : Cell(Expr)? def initialize(@location : Location, @condition : Cell(Expr), @then_branch : Cell(Expr), @else_branch : Cell(Expr)?) end def initialize(@location : Location, condition : Expr, then_branch : Expr, else_branch : Expr?) @condition = Cell.new(condition.as(Expr)) @then_branch = Cell.new(then_branch.as(Expr)) @else_branch = Cell.new(else_branch.as(Expr)) if else_branch end def to_s(io : IO) io << "if #{condition}\n#{then_branch}\nelse\n#{else_branch}\nend" end end
Constructors
Instance methods
body
Sourcebranching?
Sourcecollection
Sourcelocation
Sourcevariable
Source