Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

catch use of &foo in infix position after ws

  • Loading branch information...
commit fa59c1b325a54b632447c1bcdb01a0e68b6bc0bd 1 parent 316b40b
@TimToady TimToady authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 STD.pm6
View
16 STD.pm6
@@ -3732,9 +3732,19 @@ grammar P6 is STD {
## junctive and (all)
- token infix:sym<&>
- { <sym> <O(|%junctive_and, iffy => 1)> }
-
+ token infix:sym<&> {
+ <sym>
+ [ <?{ %*MEMOS[$¢.pos-1]<ws> }>
+ <?before <identifier> {
+ my $id = $<identifier>[0].Str;
+ if $¢.is_known('&' ~ $id) {
+ self.sorry("Function name &$id not allowed in infix position");
+ return ();
+ }
+ }>
+ ]?
+ <O(|%junctive_and, iffy => 1)>
+ }
## junctive or (any)
token infix:sym<|>
Please sign in to comment.
Something went wrong with that request. Please try again.