diff options
-rw-r--r-- | src/lexer/mod.rs | 6 | ||||
-rw-r--r-- | tests/data/lexer/0008_strings.rs | 3 | ||||
-rw-r--r-- | tests/data/lexer/0008_strings.txt | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs index ccc25b8c9..d81ea0339 100644 --- a/src/lexer/mod.rs +++ b/src/lexer/mod.rs | |||
@@ -123,7 +123,11 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind { | |||
123 | scan_literal_suffix(ptr); | 123 | scan_literal_suffix(ptr); |
124 | CHAR | 124 | CHAR |
125 | }, | 125 | }, |
126 | 'b' => return scan_byte_char_or_string(ptr), | 126 | 'b' => { |
127 | let kind = scan_byte_char_or_string(ptr); | ||
128 | scan_literal_suffix(ptr); | ||
129 | return kind | ||
130 | }, | ||
127 | _ => (), | 131 | _ => (), |
128 | } | 132 | } |
129 | ERROR | 133 | ERROR |
diff --git a/tests/data/lexer/0008_strings.rs b/tests/data/lexer/0008_strings.rs index 1ffc7bb9d..9dd1570de 100644 --- a/tests/data/lexer/0008_strings.rs +++ b/tests/data/lexer/0008_strings.rs | |||
@@ -1 +1,2 @@ | |||
1 | b'' b'x' b"foo" br"" \ No newline at end of file | 1 | b'' b'x' b"foo" br"" |
2 | b''suf b""ix br""br | ||
diff --git a/tests/data/lexer/0008_strings.txt b/tests/data/lexer/0008_strings.txt index d4ff4b558..ed8cd4bab 100644 --- a/tests/data/lexer/0008_strings.txt +++ b/tests/data/lexer/0008_strings.txt | |||
@@ -5,3 +5,10 @@ WHITESPACE 1 " " | |||
5 | BYTE_STRING 6 "b\"foo\"" | 5 | BYTE_STRING 6 "b\"foo\"" |
6 | WHITESPACE 1 " " | 6 | WHITESPACE 1 " " |
7 | RAW_BYTE_STRING 4 "br\"\"" | 7 | RAW_BYTE_STRING 4 "br\"\"" |
8 | WHITESPACE 1 "\n" | ||
9 | BYTE 6 "b\'\'suf" | ||
10 | WHITESPACE 1 " " | ||
11 | BYTE_STRING 5 "b\"\"ix" | ||
12 | WHITESPACE 1 " " | ||
13 | RAW_BYTE_STRING 6 "br\"\"br" | ||
14 | WHITESPACE 1 "\n" | ||