class

Myst::When

Inherits Myst::Node / Reference / Object

A when expression. These expressions are the fundamental building block for conditional logic (they replace the ubiquitous if expressions in most C-based languages). They can also be chained with other when or unless expressions to create a flat cascade of conditional logic, or an else expression to define an alternative if the condition is not met.

'when' condition body 'end' | 'when' condition body 'else' [ alternative ] 'end' | 'when' condition body ( when_expression | unless_expression )

Constructors

new(condition : Myst::Node, body : Myst::Node = Nop.new, alternative : Myst::Node = Nop.new)
Source

Instance methods

==(other : self)

Returns true if this reference is the same as other. Invokes same?.

accept_children(visitor)
Source
alternative
Source
alternative=(alternative : Node)
Source
body
Source
body=(body : Node)
Source
condition
Source
condition=(condition : Node)
Source
hash(hasher)

See Object#hash(hasher)