PAST representation of 'if'
- Create a PAST::Op node
- Set 'pasttype' attribute to 'if'
- Set first child as AST of condition
- Set second child as AST to evaluate if condition true
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;
}