W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: [CSS2.1] Any hope of fixing HASH #{name} to disallow numeric identifiers?

From: Andrei Polushin <polushin@gmail.com>
Date: Sun, 20 Jan 2008 03:50:28 +0600
Message-ID: <479270A4.2020604@gmail.com>
To: www-style@w3.org

Justin Rogers wrote:
> It makes more sense to deconstruct the HASH token into two separate
> tokens where Token_Hash is equal "#" and you simply paste this token
> onto the desired end part like ident or name.

There is an IDENT token, but there is no NAME token. If you would

    HASHSIGN := "#"
    NAME     := {nmchar}+

then it leads to a collision with IDENT and DIMENSION-like tokens, so
that it will be impossible to perform the tokenization without knowing
the context, e.g.:

        maybe: HASHSIGN IDENT
           or: HASHSIGN NAME

        maybe: HASHSIGN NUMBER
           or: HASHSIGN NAME

        maybe: HASHSIGN LENGTH
           or: HASHSIGN NAME '.' NAME

That is, you should either give up on parser+lexer approach, or
implement a context-sensitive lexer.

Andrei Polushin
Received on Saturday, 19 January 2008 21:51:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC