yaml-spec
yaml-spec copied to clipboard
Eliminate “Excluding c-forbidden content” in grammar
In the 1.2.2 spec, the l-bare-document production includes special language:
[207] l-bare-document ::=
s-l+block-node(-1,BLOCK-IN)
/* Excluding c-forbidden content */
The intent is to assert that the body of a document cannot contain a directive end indicator or a document end indicator. This is not entirely clear in the spec, it's not a proper part of the PEG model we use for the grammar, and overall it's just kind of a kludge.
In a future revision of the 1.2 spec, we may be able to eliminate the kludge with a few well-placed negative lookaheads.
Yes, it's the biggest "punt" in the spec, imho...
It's probably better expressed as a negative lookahead assertion in a few productions involving separating whitespace and multi-line strings.
Shouldn't be hard to make it simple.