From ec59d9bda569057727a9b04314c63e3b3adaaa95 Mon Sep 17 00:00:00 2001 From: pcpthm Date: Fri, 22 Mar 2019 03:39:05 +0900 Subject: Fix lexer not producing right token on "_" --- crates/ra_syntax/src/parsing/lexer.rs | 1 + crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs | Bin 0 -> 8 bytes 2 files changed, 1 insertion(+) create mode 100644 crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index f9362120e..36e841609 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs @@ -195,6 +195,7 @@ fn scan_ident(c: char, ptr: &mut Ptr) -> SyntaxKind { ptr.bump(); true } + ('_', None) => return UNDERSCORE, ('_', Some(c)) if !is_ident_continue(c) => return UNDERSCORE, _ => false, }; diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs new file mode 100644 index 000000000..d2757cd08 Binary files /dev/null and b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs differ -- cgit v1.2.3