Re: [csswg-drafts] [css-images-4] Editorial: comma is incorrect in syntax graph in 2.3. Gradient Color-Stops

> Why not just link to https://drafts.csswg.org/css-values-4/#comb-comma which explains this in detail, instead of re-explaining it in comments here?

I assumed you'd already checked that out and were missing something, so I explained it in a different way. ^_^

> On the other hand, it makes grammars inconsistent from any other grammar definition or regex anywhere else, which could confuse many. 

Yeah, that's my concern too.  On balance, tho, I think it's worthwhile.  CSS grammars are already pretty significantly different from most, anyway - in particular, their reliance on the CSS parser and its tokens, and the implicitly-omittable whitespace rules.  (Except for a very small number of places where we explicitly require it, you can omit *all* whitespace from your stylesheet, if you're willing to sprinkle `/**/` around in lots of places.)

> It would be better to have a specific operator for this (just like we invented #) 

I think having some special grammar-construct to represent "a comma, but this might need to be omitted" would end up kinda confusing.  It's very rarely relevant, and the rule of "doubled commas, or commas in weird places, are invalid" is obvious in practice, because it just *looks* wrong.

> than custom rules about what quantifiers apply to.

Unsure what you mean by this.  All quantifiers apply to everything.  (In fact, you can do `,?` to represent a comma that can be straight-up omitted anytime - this is used to represent some SVG grammars where commas are truly optional.)

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

Received on Monday, 3 April 2017 20:08:07 UTC