Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate “Excluding c-forbidden content” in grammar #315

Open
Thom1729 opened this issue Sep 17, 2023 · 1 comment
Open

Eliminate “Excluding c-forbidden content” in grammar #315

Thom1729 opened this issue Sep 17, 2023 · 1 comment

Comments

@Thom1729
Copy link
Collaborator

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.

@ingydotnet
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants