Permalink
Browse files

sink ops related to flow control

this busts compilation of Test.pm, because nqp::can(module {}, "anything") dies; but that needs fixing anyway
  • Loading branch information...
1 parent 9a6e1c5 commit 86687dd5417ebe3f440fd1462c1c525ae2b3dd49 @moritz moritz committed Nov 24, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/Perl6/Actions.pm
View
@@ -66,8 +66,18 @@ class Perl6::Actions is HLL::Actions does STDActions {
),
);
}
+ my %sinkable := nqp::hash(
+ 'call', 1,
+ 'callmethod', 1,
+ 'while', 1,
+ 'until', 1,
+ 'repeat_until', 1,
+ 'repeat_while', 1,
+ 'if', 1,
+ 'unless', 1,
+ );
sub autosink($past) {
- nqp::istype($past, QAST::Op) && ($past.op eq 'call' || $past.op eq 'callmethod')
+ nqp::istype($past, QAST::Op) && %sinkable{$past.op}
?? sink($past)
!! $past;
}

0 comments on commit 86687dd

Please sign in to comment.