Perl 6 Perl 6 #44

PAST representation of 'if'

We can write this using Perl 6 syntax as:

method if_stmt($/) {
    my $past := PAST::Op.new(
                  $( $<expression> ),    # condition
                  $( $<statement> ),     # eval if true
                  :pasttype('if')
                );
    make $past;
}
Copyright © 2008 Patrick Michaud