struct

Ast::ForLoop

Inherits Ast::Expr < IrNode < Struct < Value < Object

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

new(location : Location, variable : Cell(Expr), collection : Cell(Expr), body : Cell(Expr))
Source
new(location : Location, variable : Expr, collection : Expr, body : Expr)
Source

Instance methods

body
Source
body=(body : Cell(Expr))
Source
branching?
Source
collection
Source
collection=(collection : Cell(Expr))
Source
location
Source
location=(location : Location)
Source
to_s(io : IO)

Same as #inspect(io).

Source
variable
Source
variable=(variable : Cell(Expr))
Source