[csswg-drafts] [css-syntax-3] Return syntax error from parse a declaration with a trailing `;`? (#11730)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax-3] Return syntax error from parse a declaration with a trailing `;`? ==
[Parse a declaration](https://drafts.csswg.org/css-syntax-3/#parse-a-declaration) is intended for parsing `@supports` conditions. It invokes consume a declaration, which stops consuming the value when it finds `;`:

  > 5. Consume a list of component values from `input`, with `nested`, and with `<semicolon-token>` as the stop token, and set `decl`’s value to the result.

A CSS parser would fail to match `color: green;` against `<declaration>` because the input is not fully consumed. But `(color: green;)` would then match `<general-enclosed>`.

Should it return a syntax error when the next token is not `<EOF-token>` instead, like [parse a rule](https://drafts.csswg.org/css-syntax-3/#parse-a-rule), for consistency?

  > 5. If the next token from `input` is an `<EOF-token>`, return `rule`. Otherwise, return a syntax error.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11730 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 17 February 2025 16:01:56 UTC