diff options
-rw-r--r-- | src/lexer/mod.rs | 5 | ||||
-rw-r--r-- | tests/data/lexer/0004_number.rs | 3 | ||||
-rw-r--r-- | tests/data/lexer/0004_number.txt | 9 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs index 3f277bd2b..918683556 100644 --- a/src/lexer/mod.rs +++ b/src/lexer/mod.rs | |||
@@ -152,7 +152,10 @@ fn scan_char_or_lifetime(ptr: &mut Ptr) -> SyntaxKind { | |||
152 | } | 152 | } |
153 | 153 | ||
154 | fn scan_literal_suffix(ptr: &mut Ptr) { | 154 | fn scan_literal_suffix(ptr: &mut Ptr) { |
155 | 155 | if ptr.next_is_p(is_ident_start) { | |
156 | ptr.bump(); | ||
157 | } | ||
158 | ptr.bump_while(is_ident_continue); | ||
156 | } | 159 | } |
157 | 160 | ||
158 | fn scan_char_or_byte(ptr: &mut Ptr) { | 161 | fn scan_char_or_byte(ptr: &mut Ptr) { |
diff --git a/tests/data/lexer/0004_number.rs b/tests/data/lexer/0004_number.rs index 0c0d37627..dc974b553 100644 --- a/tests/data/lexer/0004_number.rs +++ b/tests/data/lexer/0004_number.rs | |||
@@ -5,4 +5,5 @@ | |||
5 | 0e+1 | 5 | 0e+1 |
6 | 0.e+1 | 6 | 0.e+1 |
7 | 0.0E-2 | 7 | 0.0E-2 |
8 | 0___0.10000____0000e+111__ \ No newline at end of file | 8 | 0___0.10000____0000e+111__ |
9 | 1i64 92.0f32 11__s \ No newline at end of file | ||
diff --git a/tests/data/lexer/0004_number.txt b/tests/data/lexer/0004_number.txt index ede39aa99..be8dee48b 100644 --- a/tests/data/lexer/0004_number.txt +++ b/tests/data/lexer/0004_number.txt | |||
@@ -16,8 +16,7 @@ INT_NUMBER 2 "0e" | |||
16 | WHITESPACE 1 " " | 16 | WHITESPACE 1 " " |
17 | INT_NUMBER 2 "0E" | 17 | INT_NUMBER 2 "0E" |
18 | WHITESPACE 1 " " | 18 | WHITESPACE 1 " " |
19 | INT_NUMBER 1 "0" | 19 | INT_NUMBER 2 "0z" |
20 | IDENT 1 "z" | ||
21 | WHITESPACE 1 "\n" | 20 | WHITESPACE 1 "\n" |
22 | INT_NUMBER 5 "01790" | 21 | INT_NUMBER 5 "01790" |
23 | WHITESPACE 1 " " | 22 | WHITESPACE 1 " " |
@@ -60,3 +59,9 @@ WHITESPACE 1 "\n" | |||
60 | FLOAT_NUMBER 6 "0.0E-2" | 59 | FLOAT_NUMBER 6 "0.0E-2" |
61 | WHITESPACE 1 "\n" | 60 | WHITESPACE 1 "\n" |
62 | FLOAT_NUMBER 26 "0___0.10000____0000e+111__" | 61 | FLOAT_NUMBER 26 "0___0.10000____0000e+111__" |
62 | WHITESPACE 1 "\n" | ||
63 | INT_NUMBER 4 "1i64" | ||
64 | WHITESPACE 1 " " | ||
65 | FLOAT_NUMBER 7 "92.0f32" | ||
66 | WHITESPACE 1 " " | ||
67 | INT_NUMBER 5 "11__s" | ||