Skip to content

πŸš€ [Feature]: Support tags and !! shorthand (!!str, !!int, !!set, !!omap)Β #24

@MariusStorhaug

Description

YAML 1.2.2 lets nodes be explicitly typed via tags. Currently any !/!! prefix is treated as plain text.

Request

Parse and honour:

  • !!str, !!int, !!float, !!bool, !!null β€” force scalar resolution
  • !!seq, !!map β€” force collection kind (mostly informational since kind is already implied)
  • !!set β€” mapping where every value is null, exposed as a hashset-like structure
  • !!omap β€” sequence of single-pair mappings, exposed as [ordered] hashtable
  • Verbatim tags !<tag:...> β€” accept and ignore (or surface as metadata)
  • Local tags !foo and %TAG directives β€” accept; behavior TBD

Spec examples covered

  • Example 2.21 β€” Miscellaneous (typed forms with !!str)
  • Example 2.23 β€” Various Explicit Tags
  • Example 2.24 β€” Global Tags
  • Example 2.25 β€” !!set
  • Example 2.26 β€” !!omap

Open questions

  • Custom tag handlers (extension API) β€” likely out of scope for v1.
  • Should unknown tags warn or silently fall through to default scalar/collection resolution? Recommend silent fall-through with a debug message.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions