Re: [css-syntax] declaration error handling

On Tue, Apr 30, 2013 at 5:28 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> Le 30/04/2013 14:14, Rune Lillesveen a écrit :
>> In "5.5.4. Consume a list of declarations" of the current ED you have:
>>
>> "anything else:
>>
>>    This is a parse error. Repeatedly consume the next input token until it
>> is a semicolon token or EOF token."
>>
>>
>> Should this have been: "... Repeatedly consume a component value ..." in
>> order to match blocks correctly?
>>
>> For instance:
>>
>>     * { # {; color: red; } }
>>
>> The hash ends up as "anything else". If you simply consume the next input
>> tokens, it means the first semi-colon inside the inner block will be the
>> end of the declaration, which is wrong.
>
> Yes, this is correct.

Yup, it's a bug.  I'll fix.

> By the way, to go further in the direction that the draft has taken lately
> and eliminate this kind of issue, I believe that "consume a primitive" could
> be entirely folded into the tokenizer (or moved to a new intermediate step)
> so that the parser works exclusively on component values rather than tokens.
> (This, of course, is only editorial and does not force any internal
> organization on implementations, even if it happens to be how tinycss works
> ;))

Yes, I think this is reasonable.  Most of the algorithms already work
equally well on token streams or component value streams; I should
just bite the bullet and have the spec by default use the
component-value semantics.

~TJ

Received on Wednesday, 1 May 2013 18:29:25 UTC