Expand description
Code-module AST typed input under the Canonical Code-Module AST Serialization (CCMAS) form (ADR-023 amended by ADR-060).
CCMAS is Rivest canonical S-expressions over the AST grammar cases:
the canonical byte output is a Rivest (s₁ s₂ … sₙ) flat list
(Sexp.txt §4.3) with <length>:<bytes> atoms (§4.2). The canonical
form is therefore identical to the crate::sexp realization’s,
so the pipeline reuses sexp’s no_alloc streaming canonicalizer
(SExprCanon) — under the CodeModuleValue typed-input IRI. There
is no size, name-width, item-count, or nesting-depth ceiling.
CodeModuleValue (the owned AST builder, alloc-gated)
constructs canonical CCMAS bytes programmatically (module,
function, atom) for reference and testing; CodeModuleCarrier
is the borrowed model-input handle the pipeline binds.
Structs§
- Code
Module Carrier - Borrowed CCMAS input handle (ADR-060 stream carrier). A thin,
Copyborrow of aSExprCanon;as_binding_valuereturns theStreamcarrier zero-copy under theCodeModuleValueIRI. - Code
Module Value - Owned CCMAS value + AST builder. Constructs canonical CCMAS bytes
programmatically for reference and testing.
alloc-gated — the pipeline binds the borrowedCodeModuleCarrierhandle, which needs no allocator. There is no width / count ceiling.
Functions§
- canonicalize
- Validate + materialize the canonical CCMAS bytes.