Skip to content

Commit bd9fad8

Browse files
committed
add conjectural infix [&foo] parsing
Variants such as [&.foo], [&(...)] also allowed. Variants with $ sigil also admitted (but not @ or %; I suppose those could be allowed if keyed 2-dimensionally).
1 parent 882094e commit bd9fad8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

STD.pm6

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,6 +3233,8 @@ grammar P6 is STD {
32333233
| :dba('bracketed infix') '[' ~ ']' <infix=.infixish('[]')>
32343234
{ $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
32353235
[ <!before '='> { self.worry("Useless use of [] around infix op") unless $*IN_META; } ]?
3236+
| :dba('infixed function') <?before '[' <[&\$]> <twigil>? [<alpha>|'('] > '[' ~ ']' <infix=.variable>
3237+
{ $<O> = $<infix><O> //.O(%additive); $<sym> = $<infix>; }
32363238
| <infix=infix_circumfix_meta_operator> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
32373239
| <infix=infix_prefix_meta_operator> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
32383240
| <infix> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }

0 commit comments

Comments
 (0)