yaml-spec icon indicating copy to clipboard operation
yaml-spec copied to clipboard

Eliminate “Excluding c-forbidden content” in grammar

Open Thom1729 opened this issue 2 years ago • 1 comments

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.

Thom1729 avatar Sep 17 '23 01:09 Thom1729

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.

ingydotnet avatar Sep 17 '23 01:09 ingydotnet