mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +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 => {
|
0 => {
|
||||||
if (self.index == self.buffer.len) {
|
if (self.index == self.buffer.len) {
|
||||||
|
result.tag = .invalid;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
self.checkLiteralCharacter();
|
self.checkLiteralCharacter();
|
||||||
@ -1326,7 +1327,7 @@ test "newline in string literal" {
|
|||||||
try testTokenize(
|
try testTokenize(
|
||||||
\\"
|
\\"
|
||||||
\\"
|
\\"
|
||||||
, &.{ .invalid, .string_literal });
|
, &.{ .invalid, .invalid });
|
||||||
}
|
}
|
||||||
|
|
||||||
test "code point literal with unicode escapes" {
|
test "code point literal with unicode escapes" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user