Re: [csswg-drafts] [css-mixins] `<dashed-function>` syntax seems invalid (#10558)

> Does it represent `<at-keyword-token>`, `<layer-name>?`, and a simple block whose value is `<rule-list>`?

Yes. However, looking at the specs, I find there's not *actually* any definition of what an `@foo` means in a grammar definition. I guess it kind of grandfathered its way in without us realizing. I'll have to fix that.

> And if I see `<production> (a)` in a value definition, is that an illegal value definition?

No? That's perfectly valid, see <https://drafts.csswg.org/css-values/#component-types>. What makes you think it would be invalid?

> Similarly as whitespaces are (usually) optional in the input, I thought they should have no meaning in a value definition.

Note that while whitespace is usually optional, we still use greedy parsing semantics, so the CSS values `foo ()` and `foo()` are different things (ident followed by a paren block, and a function); you need to add whitespace (or comments) between many token pairs to keep them separate.  The same should be taken as true for the Value Definition Syntax.

However, it should be considered a spec authoring error if we ever rely on that; there should *always* be whitespace between different tokens in our grammars (with the exception that we sometimes don't add spaces around `[]` characters, if it reads better to have them wrapped "tightly", but they never produce ambiguous parses anyway).

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10558#issuecomment-2698479249 using your GitHub account


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

Received on Tuesday, 4 March 2025 17:59:12 UTC