Subject: | parser too strict on anchor names? |
Module ver: YAML-0.84
perl ver: perl 5, version 14, subversion 2 (v5.14.2) built for cygwin-
thread-multi-64int
OS: CYGWIN_NT-6.1-WOW64
In _parse_qualifiers, anchor tokens are required to be alphanum:
$self->die('YAML_PARSE_ERR_BAD_ANCHOR')
unless $token =~ /^[a-zA-Z0-9]+$/;
The YAML 1.2 spec has a much looser defn of anchor names:
ns-anchor-char ::= ns-char - c-flow-indicator
ns-anchor-name ::= ns-anchor-char+
where ns-char is the (frighteningly huge, and probably not what they
meant to do) set:
[#x21-#x7E] | #x85 | [#xA0-#xD7FF] | [#xE000-#xFEFE] | [#xFF00-#xFFFD] |
[#x10000-#x10FFFF]
and c-flow-indicator is: “,” | “[” | “]” | “{” | “}”
My current failure case is an underscore in an anchor name, so /^\w+$/
would be sufficient for me, but it seems more investigation is needed
here.