mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 14:05:09 +00:00
LibRegex: Allow syntax characters (except ']') without escapes in classes
e.g. `[:]`
This commit is contained in:
parent
b45f3ea0f8
commit
158fe9d9ca
1 changed files with 3 additions and 6 deletions
|
@ -297,9 +297,6 @@ ALWAYS_INLINE bool PosixExtendedParser::parse_bracket_expression(ByteCode& stack
|
|||
return set_error(Error::InvalidRange);
|
||||
}
|
||||
|
||||
} else if (match(TokenType::Char) || match(TokenType::Period) || match(TokenType::Asterisk) || match(TokenType::EscapeSequence) || match(TokenType::Plus)) {
|
||||
values.append({ CharacterCompareType::Char, (ByteCodeValueType)*consume().value().characters_without_null_termination() });
|
||||
|
||||
} else if (match(TokenType::Circumflex)) {
|
||||
auto t = consume();
|
||||
|
||||
|
@ -385,9 +382,9 @@ ALWAYS_INLINE bool PosixExtendedParser::parse_bracket_expression(ByteCode& stack
|
|||
// closing bracket expression
|
||||
break;
|
||||
}
|
||||
} else
|
||||
// nothing matched, this is a failure, as at least the closing bracket must match...
|
||||
return set_error(Error::MismatchingBracket);
|
||||
} else {
|
||||
values.append({ CharacterCompareType::Char, (ByteCodeValueType)skip() });
|
||||
}
|
||||
|
||||
// check if range expression has to be completed...
|
||||
if (values.size() >= 3 && values.at(values.size() - 2).type == CharacterCompareType::RangeExpressionDummy) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue