Perl6::Grammar::statement_control

Generate the PAST representation of a control statement. This rule simple redispatches to another rule based on the control statement type (held in the KEY attribute of the parse tree node).

if (Perl6::Grammar::statement_control)

unless (Perl6::Grammar::statement_control)

Generate the PAST representation of an if or unless statement, including any else and elsif blocks. From the grammar we know that there must be an equal number of expressions and blocks, except if there's an else clause then there will be an extra block. So, we just unwrap the expression+block pairs into conditional PAST::Op nodes.


parrot