▲ | woodruffw 8 hours ago | |||||||||||||||||||||||||
The flattening out is the problem: most (all?) widely used YAML parsers represent the YAML document using the JSON object model, which means that there's no model or element representation of the anchors themselves. That in turn means that there's no way to construct a source span back to the anchor itself, because the parsed representation doesn't know where the anchor came from (only that it was flattened). | ||||||||||||||||||||||||||
▲ | VGHN7XDuOXPAzol 8 hours ago | parent [-] | |||||||||||||||||||||||||
This is something that a custom parser library could figure out, no? The same as how you have format-preserving TOML libraries, for instance. I think it makes way more sense for GitHub to support YAML anchors given they are after all part of the YAML spec. Otherwise, don't call it YAML! (This was a criticism of mine for many years, I'm very glad they finally saw the light and rectified this bug) | ||||||||||||||||||||||||||
|