Metastatic.Adapters.Erlang.ToMeta (Metastatic v0.10.4)

View Source

Transform Erlang AST (M1) to MetaAST (M2).

This module implements the abstraction function α_Erlang that lifts Erlang-specific AST structures to the meta-level representation.

Erlang AST Patterns

Erlang uses a consistent tuple-based format:

  • Literals: {type, line, value}
  • Variables: {:var, line, name}
  • Binary ops: {:op, line, op, left, right}
  • Calls: {:call, line, func, args}

Metadata Preservation

The transformation preserves M1-specific information:

  • :line - line number from source
  • :erlang_form - original Erlang construct type

Summary

Functions

Transform Erlang AST to MetaAST.

Functions

transform(unsupported)

@spec transform(term()) :: {:ok, term(), map()} | {:error, String.t()}

Transform Erlang AST to MetaAST.

Returns {:ok, meta_ast, metadata} on success or {:error, reason} on failure.