class Drizzle::AST::IfStatement

Overview

Node representing an if statement. if () (elsif () )* (else )?

Defined in:

drizzle/ast/if_statement.cr

Constructors

Instance Method Summary

Instance methods inherited from class Drizzle::AST::Node

literal : String literal, to_s : String to_s

Constructor Detail

def self.new(token : Token, condition : Expression, consequence : BlockStatement, alt_consequences : Array(IfStatement) = [] of IfStatement, alternative : BlockStatement? = nil) #

[View source]

Instance Method Detail

def alt_consequences : Array(Drizzle::AST::IfStatement) #

An optional array of alternative conditions and consequences to run in case the first condition fails


[View source]
def alternative : Drizzle::AST::BlockStatement? #

An optional alternative block to be run if all prior conditions have failed


[View source]
def condition : Drizzle::AST::Expression #

The initial condition to be tested


[View source]
def consequence : Drizzle::AST::BlockStatement #

The set of statements to be run if the initial condition has proven to be true


[View source]
def literal : String #

[View source]
def to_s : String #

[View source]
def token : Drizzle::Token #

The token that led to the creation of the statement node


[View source]