|
2 | 2 |
|
3 | 3 | > **<sup>Lexer:<sup>**
|
4 | 4 | > IDENTIFIER :
|
5 |
| -> XID_start XID_continue<sup>\*</sup> |
6 |
| -> | `_` XID_continue<sup>+</sup> |
| 5 | +> [`a`-`z` `A`-`Z`] [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>\*</sup> |
| 6 | +> | `_` [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>+</sup> |
7 | 7 |
|
8 |
| -An identifier is any nonempty Unicode[^non_ascii_idents] string of the following form: |
| 8 | +An identifier is any nonempty ASCII[^non_ascii_idents] string of the following form: |
9 | 9 |
|
10 | 10 | Either
|
11 | 11 |
|
12 |
| - * The first character has property [`XID_start`] |
13 |
| - * The remaining characters have property [`XID_continue`] |
| 12 | + * The first character is a letter |
| 13 | + * The remaining characters are alphanumeric or `_` |
14 | 14 |
|
15 | 15 | Or
|
16 | 16 |
|
17 | 17 | * The first character is `_`
|
18 | 18 | * The identifier is more than one character, `_` alone is not an identifier
|
19 |
| - * The remaining characters have property [`XID_continue`] |
| 19 | + * The remaining characters are alphanumeric or `_` |
20 | 20 |
|
21 |
| -that does _not_ occur in the set of [keywords]. |
22 |
| - |
23 |
| -> **Note**: [`XID_start`] and [`XID_continue`] as character properties cover the |
24 |
| -> character ranges used to form the more familiar C and Java language-family |
25 |
| -> identifiers. |
26 |
| -
|
27 |
| - |
28 |
| - |
29 |
| -[`XID_start`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i= |
30 |
| -[`XID_continue`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i= |
31 |
| -[keywords]: keywords.html |
32 |
| -[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature |
33 |
| - gated. This is expected to improve soon. |
| 21 | +[^non_ascii_idents] Non-ASCII characters in identifiers are currently feature-gated. See [issue #28979](https://github.com/rust-lang/rust/issues/28979). |
0 commit comments