ReviewOS

also looking at this

zig-utils/zig-regex

Port to latest zig-master

#2
Closed armagidon-exception wants to merge main into main
53 files +1149 -1017
src/parser.zigmodified+4-6
Changes to src/parser.zig
@@ -657,10 +657,7 @@ pub const Parser = struct {
657657 .dollar => '$',
658658 .lbracket => '[', // Allow [ as literal (for non-POSIX cases)
659659 // These should not appear here
660 .rbracket, .caret, .backslash,
661 .escape_d, .escape_D, .escape_w, .escape_W,
662 .escape_s, .escape_S, .escape_b, .escape_B,
663 .escape_A, .escape_z, .escape_Z, .backref, .eof => null,
660 .rbracket, .caret, .backslash, .escape_d, .escape_D, .escape_w, .escape_W, .escape_s, .escape_S, .escape_b, .escape_B, .escape_A, .escape_z, .escape_Z, .backref, .eof => null,
664661 };
665662 }
666663
@@ -685,7 +682,8 @@ pub const Parser = struct {
685682
686683 if (current_pos + 1 < self.lexer.input.len and
687684 self.lexer.input[current_pos] == '[' and
688 self.lexer.input[current_pos + 1] == ':') {
685 self.lexer.input[current_pos + 1] == ':')
686 {
689687
690688 // Find the closing :]
691689 var found_posix = false;
formatting only · 8 hidden lines
Changes to src/parser.zig
@@ -693,7 +691,7 @@ pub const Parser = struct { formatting only
693691 while (i + 1 < self.lexer.input.len) : (i += 1) {
694692 if (self.lexer.input[i] == ':' and self.lexer.input[i + 1] == ']') {
695693 // Found [:name:]
696 const class_name = self.lexer.input[current_pos + 2..i];
694 const class_name = self.lexer.input[current_pos + 2 .. i];
697695
698696 // Skip to the character AFTER ':]' which should be the outer ']' or more chars
699697 // We want the lexer to be positioned so that the NEXT token read will be correct