Resolves a call site to {module, function, arguments} and rebuilds it in the form it
was written.
Three forms are recognised: a remote call (Enum.sort(xs), :math.pi(), an aliased
module), a local call (min(a, b), resolved to the module's own function, then
Kernel, then a module it imports) and a pipe (xs |> Enum.sort(), resolved as the
call it is sugar for, with the piped value as the first argument). The call on the
right of a pipe is not resolved on its own: the |> node stands for it, so a family
never sees a call one argument short.
Summary
Functions
Whether fun/arity is a function or macro of Kernel.
The call rebuilt with another function name and arguments, in its written form: a pipe stays a pipe (its first argument is the piped value).
Resolves node to a call, or :error when it is not one.
The module of a remote call's target: an alias, __MODULE__ or an Erlang atom.
Whether argument index (0-based, piped value included) of call is a timeout.
Types
Functions
Whether fun/arity is a function or macro of Kernel.
The call rebuilt with another function name and arguments, in its written form: a pipe stays a pipe (its first argument is the piped value).
@spec resolve(Macro.t(), Juggernaut.Mutator.Context.t()) :: {:ok, call()} | :error
Resolves node to a call, or :error when it is not one.
@spec target_module(Macro.t(), Juggernaut.Mutator.Context.t()) :: {:ok, module()} | :error
The module of a remote call's target: an alias, __MODULE__ or an Erlang atom.
@spec timeout_arg?(call(), non_neg_integer()) :: boolean()
Whether argument index (0-based, piped value included) of call is a timeout.