This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Universal Character Names, v2
As I understood it, the way UCNs were supposed to work is that they're
simply the extension of the existing rules for identifiers.
Alphabetic-like characters, underscore-like characters, and digit-like
characters are valid in the places where alphabetic/underscore/digit
characters are.
So, since \u0660 ('ARAB-INDIC DIGIT ZERO') is counted as a 'digit-like
character', it can be used in the same places as a digit, that is it
can't start an identifier but can be used inside one.
... however, that applies after preprocessing. Before preprocessing,
the arrangement is somewhat different, but I believe the idea is that
any sequence of characters that might be part of an identifier is some
kind of valid preprocessor token. It looks to me that a sequence like
\u0660a
should actually be an identifier during preprocessing, despite not
being a valid identifier in translation phase 7, because you can paste
it with some other identifier to get something that _is_ valid. I
think this might be a small defect in the standard; at the least, it's
not clear.
--
- Geoffrey Keating <geoffk@geoffk.org>