Documentation
¶
Overview ¶
Package ynode spells yaml.v3 nodes: the tag a resolved `<<` merge key carries, the constructors for the node kinds a parse produces, and the merge chain the compiler's depth bounds are measured against.
It sits below nodeview, which reads MergeTag back for its merge-key predicate, rather than beside it. Both the view and the cycle scan build these nodes from their own internal test files, and an internal test file cannot import a package that imports its own — so a home above nodeview would be one the view's tests could not reach. Holding the tag here is what lets a single definition of Merge serve both.
Index ¶
Constants ¶
const MergeTag = "!!merge"
MergeTag is the tag yaml.v3 resolves every `<<` merge key to, and the exact tag speakeasy's yml.IsMergeKey requires before treating one as a merge.
Variables ¶
This section is empty.
Functions ¶
func Alias ¶
Alias builds an alias resolved to target, as yaml.v3 resolves one to the node its anchor names.
func Map ¶
Map builds a mapping from pairs, given as alternating key and value nodes — the layout yaml.v3 gives a mapping's Content.
func Merge ¶
Merge builds the `<<` merge key a parse produces, tag included: the same scalar without MergeTag is an ordinary key.
func MergeChain ¶
MergeChain builds levels mappings, each merging the next through `<<` and an alias, over a leaf mapping of one pair. Expanding the whole chain re-materializes every pair beneath each level, which is the cost the merge-depth bound exists to cap.
func MergeChainSpec ¶
MergeChainSpec is MergeChain in source form: an OpenAPI document whose x-anchors nest levels `<<` merges, with one schema per level naming a different point on the chain, so a reader that re-expands the chain at every reference pays the depth once per schema.
Types ¶
This section is empty.