# `Juggernaut.Mutator.Walk`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/mutator/walk.ex#L1)

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`).

# `env`

```elixir
@type env() :: %{
  route: (Juggernaut.Mutator.Calls.call(), Juggernaut.Mutator.Context.t() -&gt;
            route())
}
```

# `result`

```elixir
@type result() :: {[site()], [term()]}
```

# `route`

```elixir
@type route() :: {:walk | :skip | {:raw, :all | [non_neg_integer()]}, term()}
```

# `site`

```elixir
@type site() :: {Macro.t(), [non_neg_integer()], Juggernaut.Mutator.Context.t()}
```

# `clause`

```elixir
@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 `[]`).

# `compile_time`

```elixir
@spec compile_time(Macro.t(), Juggernaut.Mutator.Context.t(), env()) :: result()
```

The sites of one module-body expression (they run at compile time).

# `repeated`

```elixir
@spec repeated([Macro.t()]) :: MapSet.t(atom())
```

Variable names bound more than once across `patterns` (pins and `_` names excluded).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
