L4YAML

2.3. Type System🔗

The output AST is centered on YamlValue, a compact inductive type:

  • YamlValue.scalar — tagged string value with resolved YamlType

  • YamlValue.sequence — ordered list of values

  • YamlValue.mapping — list of key-value pairs (preserving order)

Each value is wrapped in YamlDocument, which carries document-level metadata including directive tags and version indicators.

Position tracking is provided by YamlPos (offset, line, column), enabling precise error reporting that maps back to the original input.