Skip to content

Commit

Permalink
curry *.[] and *.{} again
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Oct 27, 2013
1 parent bec62b4 commit 3a6b388
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Perl6/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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;
Expand Down

0 comments on commit 3a6b388

Please sign in to comment.