mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
LibRegex: Allow a '?' suffix for brace quantifiers
This fixes another compat point in #6042.
This commit is contained in:
parent
8d7bcc2476
commit
e9279d1790
3 changed files with 15 additions and 9 deletions
|
@ -968,10 +968,6 @@ bool ECMA262Parser::parse_quantifier(ByteCode& stack, size_t& match_length_minim
|
|||
}
|
||||
|
||||
if (match(TokenType::Questionmark)) {
|
||||
if (repetition_mark == Repetition::Explicit) {
|
||||
set_error(Error::InvalidRepetitionMarker);
|
||||
return false;
|
||||
}
|
||||
consume();
|
||||
ungreedy = true;
|
||||
}
|
||||
|
@ -990,7 +986,7 @@ bool ECMA262Parser::parse_quantifier(ByteCode& stack, size_t& match_length_minim
|
|||
match_length_minimum = 0;
|
||||
break;
|
||||
case Repetition::Explicit:
|
||||
new_bytecode.insert_bytecode_repetition_min_max(stack, repeat_min.value(), repeat_max);
|
||||
new_bytecode.insert_bytecode_repetition_min_max(stack, repeat_min.value(), repeat_max, !ungreedy);
|
||||
match_length_minimum *= repeat_min.value();
|
||||
break;
|
||||
case Repetition::None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue