View Source Sibyl.AST (Sibyl v0.1.9)

Utility module for working with ASTs

Summary

Functions

Returns true if the given argument is an Elixir AST node representing a module alias such as Enum.

Given an alias AST node, returns the fully resolved alias that said node would expand to.

Returns the :__unused__ atom.

Returns true if the given argument is equal to :__unused__. Primarily used internally.

Types

@type alias() :: {:__aliases__, term(), [atom()]}
@type ast() :: term()
@type unused() :: :__unused__

Functions

Returns true if the given argument is an Elixir AST node representing a module alias such as Enum.

@spec module(alias(), Macro.Env.t()) :: module()

Given an alias AST node, returns the fully resolved alias that said node would expand to.

For example, given: {:__aliases, unused(), [Elixir, Enum]}, returns: Enum.

@spec unused() :: ast()

Returns the :__unused__ atom.

Returns true if the given argument is equal to :__unused__. Primarily used internally.