-
Notifications
You must be signed in to change notification settings - Fork 715
[css-values] # is easy to confuse with * #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't really understand the confusion, given that # is not a multiplier in any other language that I've heard of. Why would someone just randomly decide it means *? |
¯_(ツ)_/¯ |
Wild guess: it’s a combination of
|
We should probably improve the boilerplate reference to V&U. Other than that, I don't really know what to do here. Comma is a literal in CSS, ,* would mean repeat lots of commas... |
Yeah, unfortunately I don’t have a solution to propose. But it still seems to be a problem. Perhaps I should write "So you want to add something CSS in Servo" documentation and advertise it to contributors (new and not) somehow. (Both on how to read specs in general and on Servo code in particular.) |
I should maybe update https://www.w3.org/Style/CSS/read.en.html but it's a good place to start. :) |
Don't the comma omission rules mean that top-level and argument-list |
Yes. For what it's worth, I've just changed the syntaxes in CSS Backgrounds lately to use Sebastian |
Not |
That said, I did find another example of indicating comma-separated sequences with |
Wow, we've been backported to IETF! |
So... I'm closing this as no change, given that
|
That's only equivalent to Also, it's significantly less readable / less obvious. |
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
The text was updated successfully, but these errors were encountered: