[csswg-drafts] [css-values] # is easy to confuse with *

SimonSapin has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-values] # is easy to confuse with * ==
https://drafts.csswg.org/css-values/#mult-comma introduces for 
grammars a `#` repetition which is like `*` but with comma separators.
 Terse grammars are nice, but in this case in this case this important
 difference seems easy to miss.

A couple times now I’ve reviewed a pull request from someone (not 
necessarily a new contributor) implementing CSS parsing from grammar 
in a spec like https://drafts.csswg.org/css-shapes-1/#funcdef-polygon 
. They do write a loop but don’t seem to realize that commas are 
required.

(Servo’s doesn’t use a parser generator for CSS. It’s manually-written
 recursive descent with one function or method for roughly each 
grammar term.)

In some specs (not css-shapes, which may be a bug) the `#` itself is a
 link to its definition in css-values, but even that is easy to miss.

I don’t know what to do about this, but it seems to be a recurring 
issue.

CC @tabatkins 

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/381 using your GitHub 
account

Received on Thursday, 4 August 2016 16:17:03 UTC