Skip to content

Commit 655cc68

Browse files
committed
:= and ::= must parse RHS as list assignment prec
The operator forms do that, but the initializer forms falsely generalized from = parsing.
1 parent b808250 commit 655cc68

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

STD.pm6

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,11 +2828,13 @@ grammar P6 is STD {
28282828
[
28292829
:my $infix = $<infix>.Str;
28302830
[
2831-
|| <?{ $infix eq '=' or $infix eq ':=' or $infix eq '::=' }>
2831+
|| <?{ $infix eq '=' }>
28322832
[ <EXPR(($*LEFTSIGIL eq '$' ?? (item %item_assignment) !! (item %list_prefix) ))>
28332833
|| <.panic: "Malformed initializer"> ]
2834+
|| <?{ $infix eq ':=' or $infix eq '::=' }> [
2835+
<EXPR(item %list_prefix)> || <.panic: "Malformed binding"> ]
28342836
|| <?{ $infix eq '.=' }>
2835-
[ <dottyopish> || <.panic: "Malformed method call"> ]
2837+
[ <dottyopish> || <.panic: "Malformed mutator method call"> ]
28362838
]
28372839
]
28382840
}

0 commit comments

Comments
 (0)