Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
TimToady committed Mar 2, 2012
1 parent 882094e commit bd9fad8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions STD.pm6
Expand Up @@ -3233,6 +3233,8 @@ grammar P6 is STD {
| :dba('bracketed infix') '[' ~ ']' <infix=.infixish('[]')>
{ $<O> = $<infix><O>; $<sym> = $<infix><sym>; }
[ <!before '='> { self.worry("Useless use of [] around infix op") unless $*IN_META; } ]?
| :dba('infixed function') <?before '[' <[&\$]> <twigil>? [<alpha>|'('] > '[' ~ ']' <infix=.variable>
{ $<O> = $<infix><O> //.O(%additive); $<sym> = $<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>; }
Expand Down

0 comments on commit bd9fad8

Please sign in to comment.