NAME

Zuzu::AST::Stmt::Switch - AST node for switch statements

DESCRIPTION

Represents one statement form in the abstract syntax tree and delegates execution to Zuzu::Runtime.

INHERITANCE

Inherits from Moo::Object.

ROLES

Consumes Zuzu::AST::Role::Node.

ATTRIBUTES

value_expr

Type: ConsumerOf["Zuzu::AST::Role::Node"].

Expression that is compared against each case value.

comparator

Type: Str.

Operator string used for case comparisons.

cases

Type: ArrayRef.

Case definitions. Each item is a hashref containing values and body.

default_block

Type: Maybe[InstanceOf["Zuzu::AST::Block"]].

Optional default case block.

METHODS

evaluate

Dispatches this AST node to the matching runtime evaluator.

SEE ALSO

Zuzu::AST::Role::Node.

Subclasses: none in this distribution.

COPYRIGHT AND LICENCE

Zuzu::AST::Stmt::Switch is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.