W3C home > Mailing lists > Public > www-style@w3.org > June 2012

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

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Tue, 12 Jun 2012 14:55:17 +0200
Message-ID: <4FD73C35.70009@kozea.fr>
To: www-style@w3.org
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT