[css3-syntax] Adding a "is valid identifier" flag on hash tokens

Hi,

So, ID selectors are tokenized as hash tokens, but are only valid if the 
part after # is a valid identifier (ie. not starting with a digit, two 
dashes, or a dash followed by a digit.)

http://lists.w3.org/Archives/Public/www-style/2013Feb/0449.html

#1 and #\31 are two hash tokens with the the same value after 
tokenization, but only the latter is a valid ID selector.

In order to allow the Selector parser to tell the difference, Syntax 
should add a "is valid identifier" flag on hash tokens.

(Another option is two have two types of tokens, but I don’t like it as 
Color would have to check for both. A flag is also more consistent with 
how Syntax handles <integer>.)

-- 
Simon Sapin

Received on Tuesday, 19 February 2013 16:04:12 UTC