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

Commit

Permalink
Implement postcircumfix:<( )> plus add a (passing) test for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 30, 2009
1 parent 217bb06 commit 0ed9993
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NQP/Actions.pm
Expand Up @@ -525,6 +525,10 @@ method postcircumfix:sym<ang>($/) {
:vivibase('Hash') );
}

method postcircumfix:sym<( )>($/) {
make $<arglist>.ast;
}

method value($/) {
my $past := $<quote>
?? $<quote>.ast
Expand Down
5 changes: 5 additions & 0 deletions src/NQP/Grammar.pm
Expand Up @@ -339,6 +339,11 @@ token postcircumfix:sym<ang> {
<O('%methodop')>
}

token postcircumfix:sym<( )> {
'(' <.ws> <arglist> ')'
<O('%methodop')>
}

token postfix:sym<.> { <dotty> <O('%methodop')> }

token prefix:sym<++> { <sym> <O('%autoincrement, :pirop<inc>')> }
Expand Down
8 changes: 8 additions & 0 deletions t/nqp/36-callable.t
@@ -0,0 +1,8 @@
#!./parrot nqp.pbc

# postcircumfix:<( )>

plan(1);

my $sub := { ok(1, 'works'); }
$sub();

0 comments on commit 0ed9993

Please sign in to comment.