Re: [css3-syntax] Added an "an+b parsing" section, please review

On Fri, Feb 1, 2013 at 12:43 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> All whitespace tokens are ignored. This is not the case in the "nth" grammar
>> from Selectors 3. In particular, no whitespace is allowed between a and its
>> sign, nor between a and n. (Whitespace *is* allowed around the +/- sign
>> after n, and around the whole an+b sequence.)
>>
>> nth
>>   : S* [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? |
>>          ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S*
>>   ;
>
> Damn, you're right.  Hmm.  I was *really* trying to avoid having to
> deal with spaces between the signs and the numbers.  I suppose I can
> do whitespace-stripping late, so I can check the step and fail it if
> there is any trailing whitespace.  I'll look into how I want to do
> this.

Okay, should be fixed now.  The text was already hovering at the
*edge* of being too complex for a simple serial-paragraph structure,
so I took the opportunity to rearrange it into a list instead, and
simplified a few other rules.

(Oh, and my previous treatment was *extra* wrong - it would have
parsed "2 3" as an offset of 23.)

~TJ

Received on Saturday, 2 February 2013 00:03:36 UTC