don't tokenize an invalid string literal

This commit is contained in:
Techatrix 2023-02-07 22:06:23 +01:00 committed by Veikka Tuominen
parent 1bda8be2a3
commit c63be507cf

View File

@ -739,6 +739,7 @@ pub const Tokenizer = struct {
},
0 => {
if (self.index == self.buffer.len) {
result.tag = .invalid;
break;
} else {
self.checkLiteralCharacter();
@ -1326,7 +1327,7 @@ test "newline in string literal" {
try testTokenize(
\\"
\\"
, &.{ .invalid, .string_literal });
, &.{ .invalid, .invalid });
}
test "code point literal with unicode escapes" {