Re: [csswg-drafts] [css-values] Grammar syntax for defining excluded idents for <custom-ident> productions (#11924)

> I think we could get away with a subtraction operator instead

I'd guess some of the motivation for putting the ignore-list inside the `<custom-ident>` is that it's simpler to machine-read. At least to me, it's easier to parse "custom ident but not foo" as one unit, whereas the subtraction would mean going back and rejecting things that have already been parsed. Up to this point, a single element in the grammar is one thing that's parsed. With subtraction that's a bit more complicated. Personally I also think it's a bit more confusing to read with subtraction but that's debatable.

Similar thing with being able to express all restrictions in the grammar: if you can do that, then potentially an implementation can copy and paste the grammar directly into a data file, and generate parsing code from that, without any manual intervention. (Not sure that'd ever be possible in practice but I can dream. 😅)

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


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

Received on Wednesday, 4 March 2026 10:00:20 UTC