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

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 UTC