Skip to content

Commit 25227b4

Browse files
author
Alexander Regueiro
committed
Updated section on identifiers for raw identifiers
1 parent bca50f2 commit 25227b4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/identifiers.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
> &nbsp;&nbsp; &nbsp;&nbsp; [`a`-`z` `A`-`Z`]&nbsp;[`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>\*</sup>\
66
> &nbsp;&nbsp; | `_` [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>+</sup>
77
>
8+
> RAW_IDENTIFIER : `r#` IDENTIFIER_OR_KEYWORD <sub>*Except `crate`, `extern`, `self`, `super`, `Self`*</sub>
9+
>
810
> IDENTIFIER :\
9-
> IDENTIFIER_OR_KEYWORD <sub>*Except a [strict] or [reserved] keyword*</sub>
11+
> IDENTIFIER_OR_KEYWORD <sub>*Except a [strict] or [reserved] keyword*</sub> | RAW_IDENTIFIER
1012
1113
An identifier is any nonempty ASCII string of the following form:
1214

@@ -21,5 +23,10 @@ Or
2123
* The identifier is more than one character. `_` alone is not an identifier.
2224
* The remaining characters are alphanumeric or `_`.
2325

26+
A raw identifier is like a normal identifier, but prefixed by `r#`. (Note that
27+
the `r#` prefix is not included as part of the actual identifier.)
28+
Unlike a normal identifier, a raw identifier may be any strict or reserved
29+
keyword except the ones listed above for `RAW_IDENTIFIER`.
30+
2431
[strict]: keywords.html#strict-keywords
2532
[reserved]: keywords.html#reserved-keywords

0 commit comments

Comments
 (0)