]> git.lizzy.rs Git - rust.git/blob - src/doc/unstable-book/src/language-features/non-ascii-idents.md
Rollup merge of #57859 - GuillaumeGomez:fix-background, r=QuietMisdreavus
[rust.git] / src / doc / unstable-book / src / language-features / non-ascii-idents.md
1 # `non_ascii_idents`
2
3 The tracking issue for this feature is: [#55467]
4
5 [#55467]: https://github.com/rust-lang/rust/issues/55467
6
7 ------------------------
8
9 The `non_ascii_idents` feature adds support for non-ASCII identifiers.
10
11 ## Examples
12
13 ```rust
14 #![feature(non_ascii_idents)]
15
16 const ε: f64 = 0.00001f64;
17 const Π: f64 = 3.14f64;
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]: ../reference/keywords.html#strict-keywords