ExAST.Symbols (ExAST v0.11.0)

Copy Markdown View Source

Extracts lightweight definition and reference facts from Elixir source or AST.

Summary

Functions

Returns true when a symbol matches a qualified-name string or MFA tuple.

Returns an MFA tuple when the target has a resolvable BEAM module.

Normalizes a symbol, MFA tuple, or qualified-name string to a qualified-name string.

Types

mfa_tuple()

@type mfa_tuple() :: {module(), atom(), non_neg_integer()}

symbol_target()

@type symbol_target() ::
  String.t()
  | mfa_tuple()
  | {String.t() | nil, atom() | String.t(), non_neg_integer()}
  | ExAST.Symbol.Definition.t()
  | ExAST.Symbol.Reference.t()

Functions

definitions(source_or_ast)

@spec definitions(String.t() | Macro.t()) :: [ExAST.Symbol.Definition.t()]

matches?(map, target)

Returns true when a symbol matches a qualified-name string or MFA tuple.

mfa(name)

@spec mfa(symbol_target()) :: mfa_tuple() | nil

Returns an MFA tuple when the target has a resolvable BEAM module.

qualified_name(name)

@spec qualified_name(symbol_target()) :: String.t()

Normalizes a symbol, MFA tuple, or qualified-name string to a qualified-name string.

references(source_or_ast)

@spec references(String.t() | Macro.t()) :: [ExAST.Symbol.Reference.t()]