diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs index ccc25b8c95..d81ea03395 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 { scan_literal_suffix(ptr); CHAR }, - 'b' => return scan_byte_char_or_string(ptr), + 'b' => { + let kind = scan_byte_char_or_string(ptr); + scan_literal_suffix(ptr); + return kind + }, _ => (), } ERROR diff --git a/tests/data/lexer/0008_strings.rs b/tests/data/lexer/0008_strings.rs index 1ffc7bb9d0..9dd1570de7 100644 --- a/tests/data/lexer/0008_strings.rs +++ b/tests/data/lexer/0008_strings.rs @@ -1 +1,2 @@ -b'' b'x' b"foo" br"" \ No newline at end of file +b'' b'x' b"foo" br"" +b''suf b""ix br""br diff --git a/tests/data/lexer/0008_strings.txt b/tests/data/lexer/0008_strings.txt index d4ff4b5581..ed8cd4babd 100644 --- a/tests/data/lexer/0008_strings.txt +++ b/tests/data/lexer/0008_strings.txt @@ -5,3 +5,10 @@ WHITESPACE 1 " " BYTE_STRING 6 "b\"foo\"" WHITESPACE 1 " " RAW_BYTE_STRING 4 "br\"\"" +WHITESPACE 1 "\n" +BYTE 6 "b\'\'suf" +WHITESPACE 1 " " +BYTE_STRING 5 "b\"\"ix" +WHITESPACE 1 " " +RAW_BYTE_STRING 6 "br\"\"br" +WHITESPACE 1 "\n"