Ancora.Derive.DefIndex (ancora v1.0.0-rc.1)

Copy Markdown View Source

Source-derived function and macro index for project modules.

Default arguments expand into every callable arity. Public and private definitions are kept separately so imports only resolve public API while local-call suppression can include both.

Summary

Functions

Builds an index from source without evaluating it.

True when the module has a public or private definition.

True when the module has a public definition at the given name and arity.

Returns the literal modules used by module.

Types

module_name()

@type module_name() :: String.t()

signature()

@type signature() :: {atom(), arity()}

t()

@type t() :: %Ancora.Derive.DefIndex{
  private: %{optional(module_name()) => MapSet.t(signature())},
  public: %{optional(module_name()) => MapSet.t(signature())},
  uses: %{optional(module_name()) => MapSet.t(module_name())}
}

Functions

build(source, path)

@spec build(binary(), Path.t()) :: {:ok, t()} | {:error, term()}

Builds an index from source without evaluating it.

defined?(index, module, name, arity)

@spec defined?(t(), module() | String.t(), atom(), arity()) :: boolean()

True when the module has a public or private definition.

public?(def_index, module, name, arity)

@spec public?(t(), module() | String.t(), atom(), arity()) :: boolean()

True when the module has a public definition at the given name and arity.

uses(def_index, module)

@spec uses(t(), module() | String.t()) :: MapSet.t(module_name())

Returns the literal modules used by module.