What an operator knows about the site it is offered (design notes §8.1).
The walk (Juggernaut.Mutator.Walk) builds one context per site:
position-:runtime,:patternor:guard;pattern- which kind of pattern a:patternsite is in::def(a function head),:clause(acase,fn,receive,withorforclause) or:match(the left of=), elsenil;module,function({name, arity}),clause(index among the module's clauses of that name and arity),kind(:def,:defp,:defmacro,:defmacrop);aliases(%{[:Short] => Full.Module}),imports(modules imported or used by the module),locals({name, arity}the module defines),genserver?(the module uses or declaresGenServer);pipe_stage?- the node is the call on the right of|>(call families are offered the|>node instead, so they see every argument);tail?- the node is a return path of its function orfnclause;condition?- the node is the condition of anif,unlessorcondclause;pattern_root?- the node is a whole pattern (one argument of a head, the left of a match, one pattern of a clause);repeated- variable names bound more than once in the enclosing pattern;in_rhs?- the node is the right operand ofinin a guard;timeout?- the node is a timeout or duration argument of a known call;unit?- every return path of the function is literally:okornil, and it is not marked@impl;fun_clauses- body-bearing clauses of the function;rescue?- the node is arescueclause or its pattern;capture?- the node is the body of an&capture (&(&1 + 1));negated?- the node is the operand of a unary minus (-3);key?- the node is a keyword key (open?:in%{open?: x}orf(x, timeout: 5));struct?- the node is a field of a struct literal, whose keys are never sites.match_pattern?- the node is inside the pattern of amatch?/2(walked as a runtime site and lifted,Juggernaut.Schemata.Site), where a swapped<>would not compile.
Summary
Functions
The context for a node's children: the flags that describe one node only are reset.
Types
@type t() :: %Juggernaut.Mutator.Context{ aliases: %{required([atom()]) => module()}, capture?: boolean(), clause: non_neg_integer() | nil, condition?: boolean(), fun_clauses: pos_integer(), function: {atom(), arity()} | nil, genserver?: boolean(), imports: [module()], in_rhs?: boolean(), key?: boolean(), kind: :def | :defp | :defmacro | :defmacrop, locals: MapSet.t({atom(), arity()}), match_pattern?: boolean(), module: module() | nil, negated?: boolean(), pattern: :def | :clause | :match | nil, pattern_root?: boolean(), pipe_stage?: boolean(), position: :runtime | :pattern | :guard, repeated: MapSet.t(atom()), rescue?: boolean(), struct?: boolean(), tail?: boolean(), timeout?: boolean(), unit?: boolean() }