Re: problem with t040103-ident-03-c.htm?

Stewart Brodie wrote:
> fantasai wrote:
>> According to
>>    http://www.w3.org/TR/CSS21/selector.html#id-selectors
>> an ID selector is an identifier, and these are not allowed to start with a
>> hyphen plus a number. I just checked with Bert, and he agrees the test is
>> correct.
> 
> OK.  Given that it must be an identifier, is there are reason why the rule
> in the grammar (in both specifications) should not be corrected to:
> 
> "#"{ident}   { return HASH;}
> 
> and delete the definition of 'name' completely?  This would make the grammar
> agree with the prose.  Apart from preventing "#-<digit>" being a HASH token,
> it would also prevent "#--" from generating a HASH token - also a correct
> change, I believe.
> 
> On reflection, this would have a knock-on effect in parsers that expect a
> HASH token for the value of a color property, of course.  Is that the reason
> why the grammar is still as it is?  If it is, I think that inserting a
> comment at the top of the lexical scanner would be a worthwhile addition.

Yeah, using the same token for both colors and IDs was imho not a very good
idea. If you write up the exact changes necessary to split them, I can add
this to the issues list. :)

~fantasai

Received on Wednesday, 22 August 2007 15:37:56 UTC