Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Parse subsignatures
See SO6/Closure parameters.  For example:

    sub limited_grep(Int $count, &block:(Dog)), *@list) { ... }

These currently sort-of parse, but :(Dog) is considered a *trait*, and
that doesn't sit right with something in the compiler, so it results in
this error:

    Cannot invoke this object (REPR: P6opaque, cs = 0)
  • Loading branch information
hoelzro committed Dec 7, 2014
1 parent 6345f4f commit 8c242c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Perl6/Grammar.nqp
Expand Up @@ -2822,6 +2822,11 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
|| <name=.decint> { $*W.throw($/, 'X::Syntax::Variable::Numeric', what => 'parameter') }
|| $<name>=[<[/!]>]
]?

[
<?{ ~$<sigil> eq '&' }>
':(' ~ ')' <subsignature=.signature>
]?
]
}

Expand Down

0 comments on commit 8c242c0

Please sign in to comment.