File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,8 @@ fn Parser::parse_factor(self : Parser) -> Regex raise Error_ {
508
508
}
509
509
Backreference (capture )
510
510
}
511
+ // reserve c
512
+ 'c' => raise Error_ (err = InvalidEscape , data = self .input)
511
513
_ =>
512
514
if self .flags.ignore_case {
513
515
CharClass (case_insensitive_char_class ([c , c ]), neg = false )
@@ -564,6 +566,7 @@ fn Parser::parse_char_class(self : Parser) -> Regex raise Error_ {
564
566
}
565
567
let chars = []
566
568
while self .input is [ch , .. rest ] && ch != ']' {
569
+ let escape = rest
567
570
let start_char = match ch {
568
571
'\\ ' => {
569
572
guard rest is [ch , .. rest ] else {
@@ -639,6 +642,8 @@ fn Parser::parse_char_class(self : Parser) -> Regex raise Error_ {
639
642
}
640
643
continue
641
644
}
645
+ // reserve c and k
646
+ 'c' | 'k' => raise Error_ (err = InvalidEscape , data = escape )
642
647
_ => ch
643
648
}
644
649
}
You can’t perform that action at this time.
0 commit comments