22
33> ** <sup >Lexer:<sup >** \
44> IDENTIFIER_OR_KEYWORD :\
5- >   ;  ;   ;  ; \[ ` a ` - ` z ` ` A ` - ` Z ` ] & nbsp ; \[ ` a ` - ` z ` ` A ` - ` Z ` ` 0 ` - ` 9 ` ` _ ` ] <sup >\* </sup >\
6- >   ;  ; | ` _ ` \[ ` a ` - ` z ` ` A ` - ` Z ` ` 0 ` - ` 9 ` ` _ ` ] <sup >+</sup >
5+ >   ;  ;   ;  ; XID_start XID_continue <sup >\* </sup >\
6+ >   ;  ; | ` _ ` XID_continue <sup >+</sup >
77>
88> RAW_IDENTIFIER : ` r# ` IDENTIFIER_OR_KEYWORD <sub >* Except ` crate ` , ` self ` , ` super ` , ` Self ` * </sub >
99>
1212> IDENTIFIER :\
1313> NON_KEYWORD_IDENTIFIER | RAW_IDENTIFIER
1414
15- An identifier is any nonempty ASCII string of the following form:
15+ An identifier is any nonempty Unicode string of the following form:
1616
1717Either
1818
19- * The first character is a letter .
20- * The remaining characters are alphanumeric or ` _ ` .
19+ * The first character has property [ ` XID_start ` ] .
20+ * The remaining characters have property [ ` XID_continue ` ] .
2121
2222Or
2323
2424* The first character is ` _ ` .
2525* The identifier is more than one character. ` _ ` alone is not an identifier.
26- * The remaining characters are alphanumeric or ` _ ` .
26+ * The remaining characters have property [ ` XID_continue ` ] .
27+
28+ > ** Note** : [ ` XID_start ` ] and [ ` XID_continue ` ] as character properties cover the
29+ > character ranges used to form the more familiar C and Java language-family
30+ > identifiers.
2731
2832A raw identifier is like a normal identifier, but prefixed by ` r# ` . (Note that
2933the ` r# ` prefix is not included as part of the actual identifier.)
@@ -32,3 +36,5 @@ keyword except the ones listed above for `RAW_IDENTIFIER`.
3236
3337[ strict ] : keywords.md#strict-keywords
3438[ reserved ] : keywords.md#reserved-keywords
39+ [ `XID_start` ] : http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i=
40+ [ `XID_continue` ] : http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i=
0 commit comments