Skip to content

Commit

Permalink
adapt ziglang#21371 to this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
RetroDev256 committed Sep 10, 2024
1 parent 21a0a4b commit c883116
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/std/zig/tokenizer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -768,13 +768,9 @@ pub const Tokenizer = struct {
0 => if (self.index != self.buffer.len) {
continue :state .invalid;
},
'\n' => self.index += 1,
'\r' => {
if (self.buffer[self.index + 1] == '\n') {
self.index += 2;
} else {
continue :state .invalid;
}
'\n' => {},
'\r' => if (self.buffer[self.index + 1] != '\n') {
continue :state .invalid;
},
0x01...0x09, 0x0b...0x0c, 0x0e...0x1f, 0x7f => continue :state .invalid,
else => continue :state .multiline_string_literal_line,
Expand Down Expand Up @@ -994,7 +990,6 @@ pub const Tokenizer = struct {
0, '\n' => result.tag = .doc_comment,
'\r' => {
if (self.buffer[self.index + 1] == '\n') {
self.index += 1;
result.tag = .doc_comment;
} else {
continue :state .invalid;
Expand Down Expand Up @@ -1040,12 +1035,8 @@ pub const Tokenizer = struct {
self.index += 1;
switch (self.buffer[self.index]) {
0, '\n' => {},
'\r' => {
if (self.buffer[self.index + 1] == '\n') {
self.index += 1;
} else {
continue :state .invalid;
}
'\r' => if (self.buffer[self.index + 1] != '\n') {
continue :state .invalid;
},
0x01...0x09, 0x0b...0x0c, 0x0e...0x1f, 0x7f => {
continue :state .invalid;
Expand Down

0 comments on commit c883116

Please sign in to comment.