Re: Question on parsing of "font" property

Andrew Fedoniouk wrote:
>>So?  What do font names have to do with nmtoken>
> 
> Let's take a look here:
> 
> declaration
>   : property ':' S* expr prio?
> expr
>   : term [ operator term ]*
> term
>   : unary_operator?
>     [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
>       TIME S* | FREQ S* | function ]
>   | STRING S* | IDENT S* | URI S* | hexcolor
> operator
>   : '/' S* | COMMA S* | /* empty */
>   ;

Yes, agreed.

> following this we are getting rule for a non quouted font names:
> 
> font-name: IDENT S* [, IDENT S* ]* 

You made this rule up, right?  It's not in the grammar that I can see....  As 
far as I can tell from the above, we are actually getting the following rule for 
non-quoted font names:

   font-name: term [ operator term ]*

where "operator" is not allowed to be a COMMA.  But it can certainly be 
whitespace as in:

   font: 10px Times New Roman;

or it can be a '/', per that grammar and the fact that '/' is not excluded in 
the property description.

I do agree that per the grammar '@' would indeed need to be escaped.  But a '/' 
would not.

-Boris

Received on Wednesday, 19 May 2004 22:05:52 UTC