Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[dotnet] Implement {*} parsing in JnthnNQP so that we can enter the m…
…ulti-dispatcher at any chose point in the proto.
  • Loading branch information
jnthn committed Oct 30, 2010
1 parent 413bae8 commit aa95937
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dotnet/compiler/Actions.pm
Expand Up @@ -848,6 +848,12 @@ method term:sym<nqp::op>($/) {
make $past;
}

method term:sym<onlystar>($/) {
make PAST::Op.new(
:pasttype('nqpop'), :name('multi_dispatch_over_lexical_candidates')
);
}

method args($/) { make $<arglist>.ast; }

method arglist($/) {
Expand Down
5 changes: 5 additions & 0 deletions dotnet/compiler/Grammar.pm
Expand Up @@ -437,6 +437,11 @@ token term:sym<nqp::op> {
'nqp::' $<op>=[\w+] <args>?
}

token term:sym<onlystar> {
'{*}' <?ENDSTMT>
[ <?{ $*MULTINESS eq 'proto' }> || <.panic: '{*} may only appear in proto'> ]
}

token args {
| '(' <arglist> ')'
}
Expand Down

0 comments on commit aa95937

Please sign in to comment.