Sourceror.prewalk

You're seeing just the function prewalk, go back to Sourceror module for more information.

Specs

prewalk(Macro.t(), traversal_function()) :: Macro.t()

Performs a depth-first pre-order traversal of a quoted expression.

See prewalk/3 for more information.

Link to this function

prewalk(quoted, acc, fun)

View Source

Specs

prewalk(Macro.t(), term(), traversal_function()) :: {Macro.t(), term()}

Performs a depth-first pre-order traversal of a quoted expression with an accumulator.

fun is a function that will receive the current node as a first argument and the traversal state as the second one. It must return a {quoted, state}, in the same way it would return {quoted, acc} when using Macro.prewalk/3.

The state is a map with the following keys:

  • :acc - The accumulator. Defaults to nil if none is given.