Skip to content

Commit

Permalink
Allow colon syntax on $.method
Browse files Browse the repository at this point in the history
I.e. alongside to `self.foo: 1,2` make it possible to `$.bar: 1,2`.

Resolves #3306
  • Loading branch information
vrurg committed Nov 24, 2019
1 parent 830400f commit 4a1323e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Perl6/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
token special_variable:sym<$.> {
<sym> {} <!before \w | '(' | '^' >
<sym> {} <!before \w | '(' | ':' | '^' >
<.obsvar('$.')>
}
Expand Down Expand Up @@ -1819,7 +1819,12 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
| {} <sigil> <!{ $*QSIGIL }> <?MARKER('baresigil')> # try last, to allow sublanguages to redefine sigils (like & in regex)
]
[ <?{ $<twigil> && ( $<twigil> eq '.' || $<twigil> eq '.^' ) }>
[ <.unsp> | '\\' | <?> ] <?[(]> <!RESTRICTED> <arglist=.postcircumfix>
[ <.unsp> | '\\' | <?> ] <?[(:]> <!RESTRICTED> #<arglist=.postcircumfix>
:dba('method arguments')
[
| ':' <!{ $*QSIGIL }> <arglist>
| '(' <arglist> ')'
]
]?
{ $*LEFTSIGIL := nqp::substr(self.orig(), self.from, 1) unless $*LEFTSIGIL }
}
Expand Down

0 comments on commit 4a1323e

Please sign in to comment.