Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
[nqp] simplify statement modifier logic slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpilot committed Dec 1, 2009
1 parent cd02597 commit 2665b51
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/NQP/Actions.pm
Expand Up @@ -60,15 +60,12 @@ method statement($/, $key?) {
if $<EXPR> {
my $mc := $<statement_mod_cond>[0];
my $ml := $<statement_mod_loop>[0];
$past := $<EXPR>.ast;
if $mc {
$past := PAST::Op.new($mc<cond>.ast, $<EXPR>.ast, :pasttype(~$mc<sym>), :node($/) );
if $ml {
$past := PAST::Op.new($ml<cond>.ast, $past, :pasttype(~$ml<sym>), :node($/) );
}
} elsif $ml {
$past := PAST::Op.new($ml<cond>.ast, $<EXPR>.ast, :pasttype(~$ml<sym>), :node($/) );
} else {
$past := $<EXPR>.ast;
$past := PAST::Op.new($mc<cond>.ast, $past, :pasttype(~$mc<sym>), :node($/) );
}
if $ml {
$past := PAST::Op.new($ml<cond>.ast, $past, :pasttype(~$ml<sym>), :node($/) );
}
}
elsif $<statement_control> { $past := $<statement_control>.ast; }
Expand Down

0 comments on commit 2665b51

Please sign in to comment.