tmp/tmp5mdcd8kw/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## R1 Default identifiers <a id="uaxid.def">[[uaxid.def]]</a>
|
| 2 |
+
|
| 3 |
+
### General <a id="uaxid.def.general">[[uaxid.def.general]]</a>
|
| 4 |
+
|
| 5 |
+
UAX \#31 specifies a default syntax for identifiers based on properties
|
| 6 |
+
from the Unicode Character Database, UAX \#44. The general syntax is
|
| 7 |
+
|
| 8 |
+
``` cpp
|
| 9 |
+
<Identifier> := <Start> <Continue>* (<Medial> <Continue>+)*
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
where `<Start>` has the XID_Start property, `<Continue>` has the
|
| 13 |
+
XID_Continue property, and `<Medial>` is a list of characters permitted
|
| 14 |
+
between continue characters. For C++ we add the character
|
| 15 |
+
U+005f (low line), or `_`, to the set of permitted `<Start>` characters,
|
| 16 |
+
the `<Medial>` set is empty, and the `<Continue>` characters are
|
| 17 |
+
unmodified. In the grammar used in UAX \#31, this is
|
| 18 |
+
|
| 19 |
+
``` cpp
|
| 20 |
+
<Identifier> := <Start> <Continue>*
|
| 21 |
+
<Start> := XID_Start + U+005f
|
| 22 |
+
<Continue> := <Start> + XID_Continue
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
This is described in the C++ grammar in [[lex.name]], where *identifier*
|
| 26 |
+
is formed from *identifier-start* or *identifier* followed by
|
| 27 |
+
*identifier-continue*.
|
| 28 |
+
|
| 29 |
+
### R1a Restricted format characters <a id="uaxid.def.rfmt">[[uaxid.def.rfmt]]</a>
|
| 30 |
+
|
| 31 |
+
If an implementation of UAX \#31 wishes to allow format characters such
|
| 32 |
+
as U+200d (zero width joiner) or U+200c (zero width non-joiner) it must
|
| 33 |
+
define a profile allowing them, or describe precisely which combinations
|
| 34 |
+
are permitted.
|
| 35 |
+
|
| 36 |
+
C++ does not allow format characters in identifiers, so this does not
|
| 37 |
+
apply.
|
| 38 |
+
|
| 39 |
+
### R1b Stable identifiers <a id="uaxid.def.stable">[[uaxid.def.stable]]</a>
|
| 40 |
+
|
| 41 |
+
An implementation of UAX \#31 may choose to guarantee that identifiers
|
| 42 |
+
are stable across versions of the Unicode Standard. Once a string
|
| 43 |
+
qualifies as an identifier it does so in all future versions.
|
| 44 |
+
|
| 45 |
+
C++ does not make this guarantee, except to the extent that UAX \#31
|
| 46 |
+
guarantees the stability of the XID_Start and XID_Continue properties.
|
| 47 |
+
|