Re: [css3-page] odd grammar for @page rules

Le 12/06/2012 01:22, fantasai a écrit :
> Changed to
>
>     page :
>        PAGE_SYM S* IDENT? S* pseudo_page? S*
>        '{' S* [ [ declaration ';' S* ] | margin_box ]* [ declaration ]? '}'  S*
>        ;
>     margin_box :
>        margin_sym S* '{' S* declaration? [ ';' S* declaration? ]* '}' S*
>        ;
>
> Let me know if that's correct.

This is obviously better than using 'ruleset', but I’m not sure it is 
quite right. For example, this should be valid but does not match:

{ ;  foo: bar ;;}

Proposed change: add a single '?' after the first 'declaration':

    page :
       PAGE_SYM S* IDENT? S* pseudo_page? S*
       '{' S* [ [ declaration? ';' S* ] | margin_box ]*
       [ declaration ]? '}'  S*
       ;

Also, Werner Donné pointed out that the 'page' production is not LL(k) 
(with or without the above fix.) I don’t know if this is a requirement. 
Discussion starts here:

http://lists.w3.org/Archives/Public/www-style/2012Apr/0620.html

-- 
Simon Sapin

Received on Tuesday, 12 June 2012 12:55:47 UTC