Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hook up new with/without opcodes
  • Loading branch information
TimToady committed Aug 8, 2015
1 parent 1a3f1a2 commit 66d946e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -1161,6 +1161,7 @@ Compilation unit '$file' contained the following violations:
method statement_control:sym<if>($/) {
my $count := +$<xblock> - 1;
my $past := xblock_immediate( $<xblock>[$count].ast );
$past.op(~$<sym>[$count] ~~ /with/ ?? 'with' !! 'if');
# push the else block if any, otherwise 'if' returns C<Nil> (per S04)
$past.push( $<else>
?? pblock_immediate( $<else>.ast )
Expand All @@ -1171,14 +1172,15 @@ Compilation unit '$file' contained the following violations:
$count--;
my $else := $past;
$past := xblock_immediate( $<xblock>[$count].ast );
$past.op(~$<sym>[$count] ~~ /with/ ?? 'with' !! 'if');
$past.push($else);
}
make $past;
}

method statement_control:sym<unless>($/) {
my $past := xblock_immediate( $<xblock>.ast );
$past.op('unless');
$past.op(~$<sym>);
make $past;
}

Expand Down

0 comments on commit 66d946e

Please sign in to comment.