Walks one function clause (or one compile-time module-body expression) and lists its
sites: every node an operator may be offered, with its AST path and its
Juggernaut.Mutator.Context.
Paths are child indices from the clause node, numbered as Sourceror.Zipper numbers
children (design notes §6): a call with an atom head numbers its arguments, a remote call
its head first, a two-element tuple both elements, a list its elements. A literal is
wrapped in a :__block__, so a path into one has one more step. Paths are built
reversed; Juggernaut.Mutator reverses the ones it keeps.
What is never walked: quote blocks, module attribute reads, function captures by
name (&Mod.fun/2), the positional argument of &1, keyword keys, struct names,
remote call heads, sigil contents, bitstring segment types and pinned variables. A
call routed :skip is not walked at all; a call routed raw keeps its node but not the
listed arguments (Juggernaut.Routing).
Summary
Functions
The sites of one clause, in walk order, and the routing entries that decided a call in
it. The clause node itself is the first site (path []).
The sites of one module-body expression (they run at compile time).
Variable names bound more than once across patterns (pins and _ names excluded).
Types
@type env() :: %{ route: (Juggernaut.Mutator.Calls.call(), Juggernaut.Mutator.Context.t() -> route()) }
@type route() :: {:walk | :skip | {:raw, :all | [non_neg_integer()]}, term()}
@type site() :: {Macro.t(), [non_neg_integer()], Juggernaut.Mutator.Context.t()}
Functions
@spec clause( Juggernaut.Mutator.ModuleScan.clause(), Juggernaut.Mutator.Context.t(), env() ) :: result()
The sites of one clause, in walk order, and the routing entries that decided a call in
it. The clause node itself is the first site (path []).
@spec compile_time(Macro.t(), Juggernaut.Mutator.Context.t(), env()) :: result()
The sites of one module-body expression (they run at compile time).
Variable names bound more than once across patterns (pins and _ names excluded).