Search documentation of Metastatic

# Metastatic.CLI.Inspector (Metastatic v0.2.0)

View Source

AST inspection and analysis logic for Metastatic CLI.

Provides various inspection capabilities:

- Layer filtering (core, extended, native)
- Variable extraction
- Node counting
- Depth analysis

# Summary

## Types

inspection_result()
layer()

## Functions

extract_variables(doc)

Extract only variables from a MetaAST.

inspect_document(doc, opts \\ [])

Inspect a MetaAST document.

validate_with_details(doc, mode \\ :standard)

Validate a document and return detailed validation metadata.

# Types

# inspection_result()

    @type inspection_result() :: %{
      ast: Metastatic.AST.meta_ast(),
      variables: MapSet.t(String.t()),
      layer: layer(),
      depth: non_neg_integer(),
      node_count: non_neg_integer()
    }

# layer()

    @type layer() :: :core | :extended | :native | :all

# Functions

# extract_variables(doc)

    @spec extract_variables(Metastatic.Document.t()) :: {:ok, MapSet.t(String.t())}

Extract only variables from a MetaAST.

# inspect_document(doc, opts \\ [])

    @spec inspect_document(
      Metastatic.Document.t(),
      keyword()
    ) :: {:ok, inspection_result()} | {:error, String.t()}

Inspect a MetaAST document.

Returns detailed information about the AST structure.

# validate_with_details(doc, mode \\ :standard)

    @spec validate_with_details(Metastatic.Document.t(), atom()) ::
      {:ok, Metastatic.Validator.validation_result()} | {:error, term()}

Validate a document and return detailed validation metadata.