Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove unneeded extra level of if
  • Loading branch information
lizmat committed Apr 3, 2014
1 parent 1bc429c commit 09fbdc7
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/Perl6/Actions.nqp
Expand Up @@ -1360,33 +1360,33 @@ class Perl6::Actions is HLL::Actions does STDActions {
# TODO verify that the inner block only has more/done/later blocks in it
for @inner_statements -> $/ {
if $<statement_control> -> $/ {
if $<sym> eq 'done' || $<sym> eq 'more' {
if $<sym> eq 'done' {
if nqp::istype($<xblock><EXPR>.ast.returns, $*W.find_symbol(['Whatever'])) {
# TODO error
$wild_done := block_closure($<xblock><pblock>.ast);
$wild_done.named('wild_done');
} else {
$past.push(QAST::IVal.new(:value(0))); # "DONE"
$past.push($<xblock><EXPR>.ast);
$past.push(block_closure($<xblock><pblock>.ast));
}
} elsif $<sym> eq 'more' {
if nqp::istype($<xblock><EXPR>.ast.returns, $*W.find_symbol(['Whatever'])) {
$wild_more := block_closure($<xblock><pblock>.ast);
$wild_more.named('wild_more');
} else {
$past.push(QAST::IVal.new(:value(1))); # "MORE"
$past.push($<xblock><EXPR>.ast);
$past.push(block_closure($<xblock><pblock>.ast));
}
if $<sym> eq 'done' {
if nqp::istype($<xblock><EXPR>.ast.returns, $*W.find_symbol(['Whatever'])) {
# TODO error
$wild_done := block_closure($<xblock><pblock>.ast);
$wild_done.named('wild_done');
} else {
$past.push(QAST::IVal.new(:value(0))); # "DONE"
$past.push($<xblock><EXPR>.ast);
$past.push(block_closure($<xblock><pblock>.ast));
}
} elsif $<sym> eq 'more' {
if nqp::istype($<xblock><EXPR>.ast.returns, $*W.find_symbol(['Whatever'])) {
$wild_more := block_closure($<xblock><pblock>.ast);
$wild_more.named('wild_more');
} else {
$past.push(QAST::IVal.new(:value(1))); # "MORE"
$past.push($<xblock><EXPR>.ast);
$past.push(block_closure($<xblock><pblock>.ast));
}
} elsif $<sym> eq 'wait' {
# TODO error
$wait_time:= $<xblock><EXPR>.ast;
$wait_time.named('wait_time');
$wait := block_closure($<xblock><pblock>.ast);
$wait.named('wait');
} else {
# TODO error
}
} else {
# TODO error
Expand Down

0 comments on commit 09fbdc7

Please sign in to comment.