Skip to content
Browse files

add conjectural warning on <infix><prefix>\s

  • Loading branch information...
1 parent 04216b1 commit 93d8861a121bf751764cca6e7c2790fd4d68e9e0 @TimToady TimToady committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 STD.pm6
View
9 STD.pm6
@@ -3247,7 +3247,14 @@ grammar P6 is STD {
{ $¢.check_variable($<infix>) }
| <infix=infix_circumfix_meta_operator> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
| <infix=infix_prefix_meta_operator> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
- | <infix> { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
+ | <infix> :: { $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
+ [
+ <?{ !$in_meta }> <!before \s> <?before <prefix>\s> {
+ my $i = $<infix>.Str;
+ my $p = $<prefix>[0].Str;
+ $¢.worry("$i$p is not an infix operator (to suppress warning put space between infix $i and prefix $p)");
+ }
+ ]?
| <?{ $in_meta }> :: <!>
| {} <?dotty> <.panic: "Method call found where infix expected (change whitespace?)">
| {} <?postfix> <.panic: "Postfix found where infix expected (change whitespace?)">

0 comments on commit 93d8861

Please sign in to comment.
Something went wrong with that request. Please try again.