Skip to content

Commit e942743

Browse files
committed
Fix lifetimes with raw identifiers.
Lifetimes (and labels) don't support raw identifiers.
1 parent b492524 commit e942743

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: src/identifiers.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
>
88
> RAW_IDENTIFIER : `r#` IDENTIFIER_OR_KEYWORD <sub>*Except `crate`, `extern`, `self`, `super`, `Self`*</sub>
99
>
10+
> NON_KEYWORD_IDENTIFIER : IDENTIFIER_OR_KEYWORD <sub>*Except a [strict] or [reserved] keyword*</sub>
11+
>
1012
> IDENTIFIER :\
11-
> IDENTIFIER_OR_KEYWORD <sub>*Except a [strict] or [reserved] keyword*</sub> | RAW_IDENTIFIER
13+
> NON_KEYWORD_IDENTIFIER | RAW_IDENTIFIER
1214
1315
An identifier is any nonempty ASCII string of the following form:
1416

Diff for: src/tokens.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ The two values of the boolean type are written `true` and `false`.
502502
> &nbsp;&nbsp; | `'_`
503503
>
504504
> LIFETIME_OR_LABEL :\
505-
> &nbsp;&nbsp; &nbsp;&nbsp; `'` [IDENTIFIER][identifier]
505+
> &nbsp;&nbsp; &nbsp;&nbsp; `'` [NON_KEYWORD_IDENTIFIER][identifier]
506506
507507
Lifetime parameters and [loop labels] use LIFETIME_OR_LABEL tokens. Any
508508
LIFETIME_TOKEN will be accepted by the lexer, and for example, can be used in

0 commit comments

Comments
 (0)