Skip to content

Commit ed5ac0a

Browse files
committed
Fix ambiguity of RESERVED_RAW_IDENTIFIER
This clarifies that the literals expressed in the RESERVED_RAW_IDENTIFIER rule cannot be followed by a XID_Continue character. Originally in my mind these literals were to be interpreted as tokens (and thus assume some kind of break follows them). However, since this is part of the lexer itself, this doesn't really work for it to be defined this way. This helps ensure that strings like `r#_f` or `r#selfie` are not interpreted as reserved raw identifiers.
1 parent 11f84ce commit ed5ac0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/identifiers.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ NON_KEYWORD_IDENTIFIER -> IDENTIFIER_OR_KEYWORD _except a [strict][lex.keywords.
1515
1616
IDENTIFIER -> NON_KEYWORD_IDENTIFIER | RAW_IDENTIFIER
1717
18-
RESERVED_RAW_IDENTIFIER -> `r#` (`_` | `crate` | `self` | `Self` | `super`)
18+
RESERVED_RAW_IDENTIFIER ->
19+
`r#` (`_` | `crate` | `self` | `Self` | `super`) _not immediately followed by XID_Continue_
1920
```
2021

2122
<!-- When updating the version, update the UAX links, too. -->

0 commit comments

Comments
 (0)