yamleam/anchors

Per-document anchor table.

A pure-Gleam dict mapping anchor names to their resolved YAML values. Threaded explicitly through the parser as a state parameter — the scope is lexically clear: a fresh table at the start of each document (new/0), accumulated as anchors are encountered (set/3), and looked up at alias sites (get/2). Nothing escapes the parser.

Types

pub type Anchors =
  dict.Dict(String, node.YamlNode)

Values

pub fn get(
  anchors: dict.Dict(String, node.YamlNode),
  name: String,
) -> Result(node.YamlNode, Nil)
pub fn new() -> dict.Dict(String, node.YamlNode)
pub fn set(
  anchors: dict.Dict(String, node.YamlNode),
  name: String,
  value: node.YamlNode,
) -> dict.Dict(String, node.YamlNode)
Search Document