Addcontext
This file contains the code to propagate context, using the following node functions:
- ctx_right($node, $ctx)
-
Called when
$node
appears in right-hand context$ctx
.ctx_right
should propagate the appropriate context to child nodes. - ctx_left($node, $other, $ctx)
-
Called when
$node
appears as the lvalue in an expression whose rvalue is$other
, and whose context is$ctx
.$other
may beundef
if the rvalue is not known, such as when$node
is a member of a tuple to which an array is being assigned (e.g.($a, $node) = @some_things
). If$other
is defined,ctx_left
should call itsctx_right
method with the appropriate context. Otherwise, it should return the desired right context.
This file also defines the contexts for built-in increment, binary, and unary operators, and for "magic" things like guards and loop
.