Skip to content

Commit

Permalink
Allow parse of Callable's signatures constraints without :
Browse files Browse the repository at this point in the history
This now:      `sub foo(&block (Dog --> Bool)) {...}`
Means same as: `sub foo(&block:(Dog --> Bool)) {...}`
Old behaviour was to complain about calling .Capture on a Callable

- Per TimToady's nod in https://rt.perl.org/Ticket/Display.html?id=123116#txn-1321791
- Unifies syntax with Positional unpacking that allows both `:` and whitespace
    to indicate unpacking.
  • Loading branch information
zoffixznet committed Dec 12, 2017
1 parent 4755228 commit c0f99a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -579,7 +579,10 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
token sublongname {
<subshortname> <sigterm>?
<subshortname> <sigterm=.subsigterm>?
}
token subsigterm {
[':' | <.ws> ] '(' ~ ')' <fakesignature>
}
token deftermnow { <defterm> }
Expand Down

0 comments on commit c0f99a3

Please sign in to comment.