Igniter.Code.Function (igniter v0.1.0)

Utilities for working with functions.

Summary

Functions

Returns true if the argument at the provided index exists and matches the provided pattern

Returns true if the node is a function call

Returns true if the node is a function call of the given name

Returns true if the node is a function call of the given name and arity

Moves to a function call by the given name and arity, matching the given predicate, in the current scope

Functions

Link to this function

append_argument(zipper, value)

Link to this macro

argument_matches_pattern?(zipper, index, pattern)

(macro)

Returns true if the argument at the provided index exists and matches the provided pattern

Link to this function

argument_matches_predicate?(zipper, index, func)

Link to this function

function_call?(zipper)

@spec function_call?(Sourceror.Zipper.t()) :: boolean()

Returns true if the node is a function call

Link to this function

function_call?(zipper, name)

@spec function_call?(Sourceror.Zipper.t(), atom()) :: boolean()

Returns true if the node is a function call of the given name

Link to this function

function_call?(zipper, name, arity)

@spec function_call?(Sourceror.Zipper.t(), atom(), non_neg_integer()) :: boolean()

Returns true if the node is a function call of the given name and arity

Link to this function

move_to_function_call_in_current_scope(zipper, name, arity, predicate \\ fn _ -> true end)

Moves to a function call by the given name and arity, matching the given predicate, in the current scope

Link to this function

move_to_nth_argument(zipper, index)

Link to this function

pipeline?(zipper)

Link to this function

update_nth_argument(zipper, index, func)