Permalink
Browse files

Merge pull request #223 from timo/postcircumfix_whatevercode

curry *.[] and *.{} again
  • Loading branch information...
FROGGS committed Oct 27, 2013
2 parents a33b165 + 3a6b388 commit 3cef56203c4026c75853a382273d2fa4a9709d1e
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/Perl6/Actions.nqp
View
@@ -5886,6 +5886,8 @@ class Perl6::Actions is HLL::Actions does STDActions {
%curried{'&infix:<^..^>'} := 1;
%curried{'&infix:<xx>'} := 1;
%curried{'callmethod'} := 2;
+ %curried{'&postcircumfix:<[ ]>'} := 2;
+ %curried{'&postcircumfix:<{ }>'} := 2;
}
sub whatever_curry($/, $past, $upto_arity) {
my $Whatever := $*W.find_symbol(['Whatever']);
@@ -5905,6 +5907,10 @@ class Perl6::Actions is HLL::Actions does STDActions {
# Or not a call and an op in the list of alloweds.
|| ($past.op ne 'call' && %curried{$past.op} // 0)
+
+ # or one of our new postcircumfix subs that used to be methods
+ || ($past.op eq 'call' && nqp::index($past.name, '&postcircumfix:') == 0 &&
+ %curried{$past.name} // 0)
);
my int $i := 0;
my int $whatevers := 0;

0 comments on commit 3cef562

Please sign in to comment.