diff options
Diffstat (limited to 'crates/ra_syntax/src/lexer.rs')
-rw-r--r-- | crates/ra_syntax/src/lexer.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/lexer.rs b/crates/ra_syntax/src/lexer.rs index c6acd095e..0c3847120 100644 --- a/crates/ra_syntax/src/lexer.rs +++ b/crates/ra_syntax/src/lexer.rs | |||
@@ -190,13 +190,12 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { | |||
190 | } | 190 | } |
191 | 191 | ||
192 | fn scan_ident(c: char, ptr: &mut Ptr) -> SyntaxKind { | 192 | fn scan_ident(c: char, ptr: &mut Ptr) -> SyntaxKind { |
193 | let is_single_letter = match ptr.current() { | 193 | match (c, ptr.current()) { |
194 | None => true, | 194 | ('r', Some('#')) => { |
195 | Some(c) if !is_ident_continue(c) => true, | 195 | ptr.bump(); |
196 | _ => false, | 196 | } |
197 | }; | 197 | ('_', Some(c)) if !is_ident_continue(c) => return UNDERSCORE, |
198 | if is_single_letter { | 198 | _ => {} |
199 | return if c == '_' { UNDERSCORE } else { IDENT }; | ||
200 | } | 199 | } |
201 | ptr.bump_while(is_ident_continue); | 200 | ptr.bump_while(is_ident_continue); |
202 | if let Some(kind) = SyntaxKind::from_keyword(ptr.current_token_text()) { | 201 | if let Some(kind) = SyntaxKind::from_keyword(ptr.current_token_text()) { |