Skip to content

Commit 3725e26

Browse files
committed
move $( ~ ) into variable token
This way contextualizers in code, quotes _and_ regexes behave the same.
1 parent a8bc48f commit 3725e26

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

STD.pm6

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,7 @@ grammar P6 is STD {
24722472
| <sigil> <index=.decint> [<?{ $*IN_DECL }> <.panic: "Cannot declare a numeric variable">]?
24732473
# Note: $() can also parse as contextualizer in an expression; should have same effect
24742474
| <sigil> <?before '<'> <postcircumfix> [<?{ $*IN_DECL }> <.panic: "Cannot declare a match variable">]?
2475-
| <sigil> <?before '('> <postcircumfix> [<?{ $*IN_DECL }> <.panic: "Cannot declare a contextualizer">]?
2475+
| :dba('contextualizer') <sigil> '(' ~ ')' <semilist> { $*LEFTSIGIL ||= $<sigil>.Str } <O(|%term)> [<?{ $*IN_DECL }> <.panic: "Cannot declare a contextualizer">]?
24762476
| <sigil> <?{ $*IN_DECL }>
24772477
| <?> {
24782478
if $*QSIGIL {
@@ -3190,9 +3190,6 @@ grammar P6 is STD {
31903190
<O(|%term)>
31913191
}
31923192

3193-
token circumfix:sigil
3194-
{ :dba('contextualizer') <sigil> '(' ~ ')' <semilist> { $*LEFTSIGIL ||= $<sigil>.Str } <O(|%term)> }
3195-
31963193
token circumfix:sym<( )>
31973194
{ :dba('parenthesized expression') '(' ~ ')' <semilist> <O(|%term)> }
31983195

0 commit comments

Comments
 (0)