Skip to content

Commit fe05c9c

Browse files
committed
warn on Useless use of [] around infix op
1 parent 84ca780 commit fe05c9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

STD.pm6

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,9 @@ grammar P6 is STD {
31453145
%<O><dba> = 'adverb';
31463146
}
31473147
| [
3148-
| :dba('bracketed infix') '[' ~ ']' <infix=.infixish('[]')> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
3148+
| :dba('bracketed infix') '[' ~ ']' <infix=.infixish('[]')>
3149+
{ $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
3150+
[ <!before '='> { self.worry("Useless use of [] around infix op") unless $*IN_META; } ]?
31493151
| <infix=infix_circumfix_meta_operator> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
31503152
| <infix=infix_prefix_meta_operator> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
31513153
| <infix> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }

0 commit comments

Comments
 (0)