Re: [csswg-drafts] [css-values] ambiguity when matching syntax to value (#6695)

When a grammar is ambiguous, there's no pre-specified resolution strategy, beyond the one you've already found for assigning `<custom-ident>`s.

Ambiguous grammars fall into three cases:

* disambiguated in prose; this is relatively rare (I can't recall one that does it off the top of my head, but I know there are)
* the grammar is deliberately ambiguous in a harmless way, to specifically highlight a particular case in the more general grammar that we want to discuss specially in the prose below
* it's an error and should be reported ^_^

> Does the order of syntax definition changes the matching process? would a sort within a group (one-of,any-of,all-of) change the meaning of a syntax?

Order is not important. (It's only relevant for *serialization* purposes, where you use the grammar order to serialize things that could be in multiple orders, so we have a predictable result without having to specify orders constantly by hand.)

> The order that a matcher would go through the possibilities would change the result. Are there rules for the order of matching (mismatching)?

n/a

> Are there any other positionally-ambiguous cases like `<custom-ident>`? matches that allow registering match state that can be reclaimed in some way?

Don't think so; if there are it's a one-off and should be handled in specific prose.

> Can there be more then 1 `<custom-ident>` in a syntax?

Yeah def. Having more than one *positionally-ambiguous* `<custom-ident>` would be a problem, as the general rule doesn't cover that case.

> Regarding the rule that says that <custom-ident> is only valid when unclaimed. Does it take affect if the potential keyword in the syntax is never checked against? for example when the keyword is at the end of some optional group and the value is matched completely before reaching it.

I'm not entirely sure what you mean here, but I *think* you're referring to order again? The rule is just that you try your *best* to satisfy the grammar while ignoring the `<custom-ident>`, and then if there's a keyword left over that would cause the grammar to fail that the `<custom-ident>` could claim, it gets it.

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


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

Received on Wednesday, 29 September 2021 14:40:24 UTC