Created
June 27, 2012 18:32
-
-
Save colomon/3005906 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :dba('infixed function') <?before '[' <[&\$]> <twigil>? [<alpha>|'('] > '[' ~ ']' <infix=.variable> | |
{ $O = $<infix><O> // <O(|%additive)>; $sym = $<infix>; } | |
method infixish($/) { | |
if $<colonpair> || $<regex_infix> { | |
return Nil; # handled elsewhere | |
} | |
if $<infix>.reduced eq 'variable' { # ie $<infix> is a variable | |
my $ast = $Operator_Function.new(function => | |
self.do_variable_reference($/, $<infix>.ast), | |
:arity(2)); | |
self.check_variable($<infix>); | |
make $ast; | |
} elsif $<assign_meta_operator> { | |
# TODO: there should probably be at least a potential for others | |
make $<infix>.ast.meta_assign; | |
} else { | |
make $<infix>.ast; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment