shape/anchor/a sequence holding an alias to itself

sha256 fed6e70f040da6941323f782c2ac92fdf4ec942fd3bb0aa471a06402547c4d3a

Document

kept:
  nested: 1
  list:
    - a
    - b
also: |
  literal
  content
recursive: &x [ *x ]

Corpus

grammarvalid, vouched for up to construct
anchor/alias-recursiveaccept from parse on, 3.2.1: an anchor identifies its node from where the node begins, so an alias within it resolves
anchor/cyclic-meaningopen from construct on: each parser's stance decides
featuresnone
meaning (yaml-1.2-core)(cyclic: no JSON form)

Answer groups

verdict split

go-yaml yaml.v3 yamlstar

refuse by the loader

libfyaml

accept, then the loader refuses past parse

perlref

accept

value

No source answered.

roundtrip

No source answered.

Each parser

parserverdictvalueround tripreasonmessage
perlref accepted accept n/i n/i
libfyaml accepted refuse by the loader unscored n/i value: the loader rejects the document past parse, where the verdict is given ValueError: Failed to parse YAML/JSON
yamlstar rejected, as declared refuse by the loader rejected, as declared n/i anchor/cyclic-meaning: the loader knows an anchor only once its node ends, so an alias inside that node names nothing: "a: &x [ *x ]" rejects the document with "Unknown anchor: x"
value: anchor/cyclic-meaning: the loader knows an anchor only once its node ends, so an alias inside that node names nothing: "a: &x [ *x ]" rejects the document with "Unknown anchor: x"
Error: Unknown anchor: x
yaml.v3 rejected, as declared refuse by the loader rejected, as declared refused anchor/cyclic-meaning: yaml.v3 rejects an alias inside the node its anchor names, with "anchor 'x' value contains itself"
value: anchor/cyclic-meaning: yaml.v3 rejects an alias inside the node its anchor names, with "anchor 'x' value contains itself"
yaml.v3: yaml: anchor 'x' value contains itself
go-yaml rejected, as declared refuse by the loader rejected, as declared refused anchor/cyclic-meaning: go-yaml refuses this on purpose
value: anchor/cyclic-meaning: go-yaml refuses this on purpose
[9:18] a cycle cannot be written as JSON

Corpus compact, 28279 cases, yamlcorpus/48. Run 2026-11-26 22:12 UTC, 23m30s.