Re: [css-syntax] <an+b> grammar

On Monday 2013-05-13 10:54 -0700, Tab Atkins Jr. wrote:
> On Mon, May 13, 2013 at 10:49 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> > On Sat, May 11, 2013 at 1:36 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> >> Hi TJ,
> >>
> >> I like your new approach for defining an+b, but I think that the grammar is missing a few clauses for when A is implicitly 1:
> >>
> >> n+3
> >> +n+3
> >> -n+3
> >
> > Should be fixed now.  I had to add 8 more clauses to the production,
> > but they group naturally with the existing ones, so it should still be
> > easy enough to understand.
> 
> I'll note, though, that this is now technically *slightly* more
> permissive than the original grammar: if you use any of the "+n"
> forms, whitespace is now allowed between the "+" and the "n", while it
> was illegal originally.  I couldn't wipe that out without abandoning
> property grammar entirely, since property grammar is entirely agnostic
> to whitespace between tokens.

We did intentionally decide not to allow whitespace.  I'd prefer to
leave it that way; it could be confusing for authors if some
variations allow whitespace in certain places and some don't, and
I'm unhappy with the idea of signed numbers allowing whitespace
between the sign and the number.

Also, I don't see what in the spec says that this is "a property
grammar" or what says that "a property grammar" allows implicit
whitespace between tokens.  When I initially read it, I was about to
send a comment that it needs to allow whitespace.

> It was also always unclear whether comments were allowed inside of
> an+b.  It's now clear by default, since I'm using a property grammar.

I don't have an opinion here.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Saturday, 18 May 2013 07:34:11 UTC