63 lines
2.4 KiB
Markdown
63 lines
2.4 KiB
Markdown
[uaxid.def]
|
||
|
||
# Annex E (informative) Conformance with UAX #31 [[uaxid]](./#uaxid)
|
||
|
||
## E.2 R1 Default identifiers [uaxid.def]
|
||
|
||
### [E.2.1](#general) General [[uaxid.def.general]](uaxid.def.general)
|
||
|
||
[1](#general-1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/uax31.tex#L24)
|
||
|
||
UAX #31 specifies a default syntax for identifiers
|
||
based on properties from the Unicode Character Database, UAX #44[.](#general-1.sentence-1)
|
||
|
||
The general syntax is
|
||
|
||
```
|
||
<Identifier> := <Start> <Continue>* (<Medial> <Continue>+)*
|
||
|
||
```
|
||
where <Start> has the XID_Start property,<Continue> has the XID_Continue property, and<Medial> is a list of characters permitted between continue characters[.](#general-1.sentence-2)
|
||
|
||
For C++ we add the character U+005f low line, or _,
|
||
to the set of permitted <Start> characters,
|
||
the <Medial> set is empty, and
|
||
the <Continue> characters are unmodified[.](#general-1.sentence-3)
|
||
|
||
In the grammar used in UAX #31, this is
|
||
|
||
```
|
||
<Identifier> := <Start> <Continue>*
|
||
<Start> := XID_Start + U+005f
|
||
<Continue> := <Start> + XID_Continue
|
||
|
||
```
|
||
|
||
[2](#general-2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/uax31.tex#L45)
|
||
|
||
This is described in the C++ grammar in [[lex.name]](lex.name "5.11 Identifiers"),
|
||
where [*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") is formed from[*identifier-start*](lex.name#nt:identifier-start "5.11 Identifiers [lex.name]") or[*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") followed by [*identifier-continue*](lex.name#nt:identifier-continue "5.11 Identifiers [lex.name]")[.](#general-2.sentence-1)
|
||
|
||
### [E.2.2](#stable) R1b Stable identifiers [[uaxid.def.stable]](uaxid.def.stable)
|
||
|
||
[1](#stable-1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/uax31.tex#L53)
|
||
|
||
An implementation of UAX #31 may choose to guarantee
|
||
that identifiers are stable across versions of the Unicode Standard[.](#stable-1.sentence-1)
|
||
|
||
Once a string qualifies as an identifier it does so in all future versions[.](#stable-1.sentence-2)
|
||
|
||
[2](#stable-2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/uax31.tex#L58)
|
||
|
||
C++ does not make this guarantee,
|
||
except to the extent that UAX #31 guarantees
|
||
the stability of the XID_Start and XID_Continue properties[.](#stable-2.sentence-1)
|