LibRegex: Consider EOF in the middle of a range an error

This commit is contained in:
Ali Mohammad Pur 2021-07-13 02:26:52 +04:30 committed by Gunnar Beutner
parent 1b2728f1ed
commit 9cdea2d521

View file

@ -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