Re: [csswg-drafts] [css-nesting-1] Syntax Invites Errors (#7834)

To add to Mia's excellent responses above, it *is* actually fairly common for the *last* thing in a sequence to have more forgiving syntax, for example:

- In CSS, the last semicolon in a declaration list is optional
- In CSS, the last closing brace is optional
- In JS, commas after array elements are mandatory, except for the last one
- In JS, commas after function arguments are mandatory, except for the last one
- In JS, commas after key:value pairs in object literals are mandatory, except for the last one

I'd argue the last n-1 things having more forgiving syntax than the first one is a fairly similar pattern to the first n-1 things having the stricter syntax and the last one having the more forgiving syntax.  

Also, there are two ways to frame this:
1. Either @nest OR a &-prefixed rule can switch parsing mode and both are fine
2. `@nest;` is mandatory; but CSS will error correct and insert it if it encounters &-prefixed rule.

I wonder if some of the people against this proposal would be more amenable to the second framing?
Though these are not necessarily entirely equivalent, there could be OM differences, depending on how we represent `@nest` in the OM.

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


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

Received on Thursday, 6 October 2022 16:34:00 UTC