Skip to main content

Module value

Module value 

Source
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§

CodeModuleCarrier
Borrowed CCMAS input handle (ADR-060 stream carrier). A thin, Copy borrow of a SExprCanon; as_binding_value returns the Stream carrier zero-copy under the CodeModuleValue IRI.
CodeModuleValue
Owned CCMAS value + AST builder. Constructs canonical CCMAS bytes programmatically for reference and testing. alloc-gated — the pipeline binds the borrowed CodeModuleCarrier handle, which needs no allocator. There is no width / count ceiling.

Functions§

canonicalize
Validate + materialize the canonical CCMAS bytes.