Expand description
Arena-backed AST construction.
BorrowedAllocator<'a> is the sole AST builder for the
crate::borrowed AST. It owns an Interner so byte-equal
strings (ruby readings, container labels, kaeriten marks) share a
single arena allocation.
§Naming convention
make_*methods build payload references (&'a Gaiji<'a>,&'a Annotation<'a>) without wrapping them in a node.- Variant-named methods (
ruby,bouten,gaiji, …) build the finalborrowed::AozoraNode<'a>. Thegaijiandannotationnode constructors take the payload reference (built viamake_gaiji/make_annotation) so a payload can be shared between aSegmentand aNodewithout recomputing the string interns. seg_*methods build segment elements forcontent_segments.
§Canonicalisation
Both content_plain("") and content_segments(&[]) return
borrowed::Content::EMPTY (i.e. Segments(&[])). content_segments
collapses an all-Text input into a single concatenated Plain
(the concatenation is interned). The legacy owned Content::from
/ Content::from_segments helpers used the same canonicalisation;
preserving it keeps the determinism + sentinel-alignment
proptests in aozora-lex/tests/property_borrowed_arena.rs honest
across edits.
Structs§
- Borrowed
Allocator - Arena-backed builder for
borrowed::AozoraNode<'a>and its payload types.