Re: [csswg-drafts] [css-selectors-4] Include whitespace in non-optional `<combinator>` (#7027)

> Is there a difference between obey longest-match semantics and greedy?

Yes, greedy means the first thing to match a segment claims that segment forever, even if it would cause the overall match to fail. Longest-match is *somewhat* greedy - the parse that consumes the most tokens for a production is the one that wins, even if it would cause the overall match to fail, but that isn't necessarily the "first" (it depends on how you order the productions).

CSS *tokenization* is explicitly designed to be longest-match; it will always parse `foo(` as a function-token, not as an ident-token followed by a parentheses delim-token, for example. CSS grammar parsing is not longest-match, at least in general.

-----

Anyway, fixed the issue here by adding an explicit prose requirement that whitespace is required if you omit the combinator.

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


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

Received on Tuesday, 15 February 2022 00:17:13 UTC