mirror of
https://github.com/ziglang/zig.git
synced 2025-12-15 02:33:07 +00:00
don't tokenize an invalid string literal
This commit is contained in:
parent
1bda8be2a3
commit
c63be507cf
@ -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" {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user