Skip to content

Commit

Permalink
catch use of &foo in infix position after ws
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed May 3, 2013
1 parent 316b40b commit fa59c1b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions STD.pm6
Expand Up @@ -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<|>
Expand Down

0 comments on commit fa59c1b

Please sign in to comment.