W3C home > Mailing lists > Public > www-style@w3.org > February 2013

Re: [css3-syntax] Parser rewritten as recursive-descent, review requested

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 13 Feb 2013 10:04:28 -0800
Message-ID: <CAAWBYDBMcqUs973ub0yoXe1fawT309Yfv96GBJ2Bo1v2fUBDTA@mail.gmail.com>
To: Mircea Piturca <mircea@typefolly.com>
Cc: www-style list <www-style@w3.org>
On Wed, Feb 13, 2013 at 7:53 AM, Mircea Piturca <mircea@typefolly.com> wrote:
> 5.4.5. Consume a list of declarations
> ident token
> "Initialize a temporary list initially filled with the current input token.
> Repeatedly consume a component value from the next input token until a
> semicolon token or EOF token is returned,"
>
> Having the following CSS:
> .a { top: 10px }
> .b { top: 20px; left 30px }
>
> If we parse the first rule declarations: { top: 10px },  the parser will now
> have a simple block containing WS, IDENT, COLON, WS, DIMMENSION, WS .
> Even if the declaration is valid it will not be returned at 5.4.5. because
> neither semicolon or EOF are found, unless EOF stands here as the end of
> this simple block stream and not the end of the overall file.
> So I think that at 5.4.5. the declaration should be returned by an
> SEMICOLON, EOF or at the end of the block.

Note how that algorithm is called - in "consume a qualified rule" it
states "Consume a list of declarations from the block's value."  That
means that it's only consuming the list of tokens from inside the
block, not the full token stream.

Thus, when the block's contents are exhausted, an EOF token is
supplied instead, and the section you quote is accurate.

~TJ
Received on Wednesday, 13 February 2013 18:05:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT