Helpers over Sourceror's AST (docs/dependencies/sourceror.md).
Sourceror wraps every literal in a one-element :__block__ (1 is
{:__block__, [token: "1", ...], [1]}); a two-element tuple is wrapped the same way.
These helpers build and read such literals, resolve aliases, compare nodes without
their metadata and render a node back to source.
Summary
Functions
The module an __aliases__ node names, with the module's aliases expanded.
node with all metadata removed, for structural comparison.
The elements of a list literal, or :error.
A literal node, wrapped as Sourceror wraps literals.
Whether node is a wrapped literal for which guard holds.
The value of a wrapped literal, or :error for any other node.
Whether node is a variable whose name does not start with _.
Renders node to source with the Elixir formatter, without reading the project's
.formatter.exs and without comments.
Whether two nodes are equal apart from metadata.
node without comment metadata, so rendering never re-emits comments.
A tuple node of elements, keeping the metadata of original when given.
The elements of a tuple literal ({a, b} or {a, b, c}), or :error.
Whether node is a variable (any name, _ included).
Functions
@spec alias_module(Macro.t(), %{required([atom()]) => module()}, module() | nil) :: {:ok, module()} | :error
The module an __aliases__ node names, with the module's aliases expanded.
node with all metadata removed, for structural comparison.
The elements of a list literal, or :error.
A literal node, wrapped as Sourceror wraps literals.
Whether node is a wrapped literal for which guard holds.
The value of a wrapped literal, or :error for any other node.
Whether node is a variable whose name does not start with _.
Renders node to source with the Elixir formatter, without reading the project's
.formatter.exs and without comments.
Whether two nodes are equal apart from metadata.
node without comment metadata, so rendering never re-emits comments.
A tuple node of elements, keeping the metadata of original when given.
The elements of a tuple literal ({a, b} or {a, b, c}), or :error.
Whether node is a variable (any name, _ included).