Ancora.Derive.Resolver (ancora v1.0.0)

Copy Markdown View Source

Pure, two-pass source resolver for calls in tagged test files.

Pass A indexes local definitions and module-wide imports. Pass B walks calls with lexical alias frames and applies the disposition ladder from the ancora.derive contract.

Summary

Functions

Resolves one source file using data supplied by Ancora.Derive.context/4.

Types

result()

@type result() :: %{
  calls: MapSet.t(Ancora.Derive.binding()),
  unresolved: [unresolved()],
  findings: [Ancora.Finding.t()]
}

unresolved()

@type unresolved() :: %{
  kind: unresolved_kind(),
  name: atom() | nil,
  arity: arity() | nil,
  file: Path.t(),
  line: pos_integer()
}

unresolved_kind()

@type unresolved_kind() :: :unqualified | :dynamic_module | :apply

Functions

resolve(source, path, ctx)

@spec resolve(binary(), Path.t(), map()) :: {:ok, result()}

Resolves one source file using data supplied by Ancora.Derive.context/4.