mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
parent
943176bbfc
commit
0676c04681
1 changed files with 3 additions and 0 deletions
|
|
@ -535,6 +535,8 @@ pub const Tokenizer = struct {
|
|||
switch (self.buffer[self.index]) {
|
||||
0 => if (self.index == self.buffer.len) {
|
||||
result.tag = .invalid;
|
||||
} else {
|
||||
continue :state .invalid;
|
||||
},
|
||||
'\n' => result.tag = .invalid,
|
||||
else => continue :state .invalid,
|
||||
|
|
@ -1250,6 +1252,7 @@ test "invalid token characters" {
|
|||
|
||||
test "invalid literal/comment characters" {
|
||||
try testTokenize("\"\x00\"", &.{.invalid});
|
||||
try testTokenize("`\x00`", &.{.invalid});
|
||||
try testTokenize("//\x00", &.{.invalid});
|
||||
try testTokenize("//\x1f", &.{.invalid});
|
||||
try testTokenize("//\x7f", &.{.invalid});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue