authorgravatar for techatrix@mailbox.orgTechatrix <techatrix@mailbox.org> 2023-02-07 22:06:23+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-02-11 14:25:25+02:00
logc63be507cf0e9ccbd45cc70e4dc0ac619930733c
tree38e55901af67952de2fc90efc924566011df70ac
parent1bda8be2a3504d0d9f6d66d69f85ecd4db447b09

don't tokenize an invalid string literal


1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/zig/tokenizer.zig+2-1
......@@ -739,6 +739,7 @@ pub const Tokenizer = struct {
739739 },
740740 0 => {
741741 if (self.index == self.buffer.len) {
742 result.tag = .invalid;
742743 break;
743744 } else {
744745 self.checkLiteralCharacter();
......@@ -1326,7 +1327,7 @@ test "newline in string literal" {
13261327 try testTokenize(
13271328 \\"
13281329 \\"
1329 , &.{ .invalid, .string_literal });
1330 , &.{ .invalid, .invalid });
13301331}
13311332
13321333test "code point literal with unicode escapes" {