From ed5ac0a127e60089c59f97bdef658075706046b5 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 20 Dec 2025 11:37:04 -0800 Subject: [PATCH] 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. --- src/identifiers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/identifiers.md b/src/identifiers.md index e8fe1d14bb..3a5cf2432d 100644 --- a/src/identifiers.md +++ b/src/identifiers.md @@ -15,7 +15,8 @@ NON_KEYWORD_IDENTIFIER -> IDENTIFIER_OR_KEYWORD _except a [strict][lex.keywords. IDENTIFIER -> NON_KEYWORD_IDENTIFIER | RAW_IDENTIFIER -RESERVED_RAW_IDENTIFIER -> `r#` (`_` | `crate` | `self` | `Self` | `super`) +RESERVED_RAW_IDENTIFIER -> + `r#` (`_` | `crate` | `self` | `Self` | `super`) _not immediately followed by XID_Continue_ ```