Skip to content

Commit 8d20030

Browse files
committed
Moved details of unstable non-ascii identifiers from the Reference to the Unstable book
1 parent 64ee7d1 commit 8d20030

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/doc/unstable-book/src/language-features/non-ascii-idents.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,34 @@ The `non_ascii_idents` feature adds support for non-ASCII identifiers.
1515

1616
const ε: f64 = 0.00001f64;
1717
const Π: f64 = 3.14f64;
18-
```
18+
```
19+
20+
## Changes to the language reference
21+
22+
> **<sup>Lexer:<sup>**
23+
> IDENTIFIER :
24+
> &nbsp;&nbsp; &nbsp;&nbsp; XID_start XID_continue<sup>\*</sup>
25+
> &nbsp;&nbsp; | `_` XID_continue<sup>+</sup>
26+
27+
An identifier is any nonempty Unicode string of the following form:
28+
29+
Either
30+
31+
* The first character has property [`XID_start`]
32+
* The remaining characters have property [`XID_continue`]
33+
34+
Or
35+
36+
* The first character is `_`
37+
* The identifier is more than one character, `_` alone is not an identifier
38+
* The remaining characters have property [`XID_continue`]
39+
40+
that does _not_ occur in the set of [strict keywords].
41+
42+
> **Note**: [`XID_start`] and [`XID_continue`] as character properties cover the
43+
> character ranges used to form the more familiar C and Java language-family
44+
> identifiers.
45+
46+
[`XID_start`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i=
47+
[`XID_continue`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i=
48+
[strict keywords]: keywords.html#strict-keywords

0 commit comments

Comments
 (0)