mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
LibRegex: Consider EOF in the middle of a range an error
This commit is contained in:
parent
1b2728f1ed
commit
9cdea2d521
1 changed files with 3 additions and 0 deletions
|
@ -193,6 +193,9 @@ ALWAYS_INLINE bool AbstractPosixParser::parse_bracket_expression(Vector<CompareT
|
|||
} else if (values.last().type == CharacterCompareType::Char) {
|
||||
values.append({ CharacterCompareType::RangeExpressionDummy, 0 });
|
||||
|
||||
if (done())
|
||||
return set_error(Error::MismatchingBracket);
|
||||
|
||||
if (match(TokenType::HyphenMinus)) {
|
||||
consume();
|
||||
// Valid range, add ordinary character
|
||||
|
|
Loading…
Add table
Reference in a new issue