mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
LibRegex: Avoid using GenericLexer::consume() when at eof
Fixes #10027.
This commit is contained in:
parent
047c013be0
commit
8e3fe80c06
1 changed files with 4 additions and 1 deletions
|
@ -2229,6 +2229,7 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '(':
|
case '(':
|
||||||
|
lexer.consume();
|
||||||
if (lexer.consume_specific('?')) {
|
if (lexer.consume_specific('?')) {
|
||||||
// non-capturing group '(?:', lookaround '(?<='/'(?<!', or named capture '(?<'
|
// non-capturing group '(?:', lookaround '(?<='/'(?<!', or named capture '(?<'
|
||||||
if (!lexer.consume_specific('<'))
|
if (!lexer.consume_specific('<'))
|
||||||
|
@ -2242,8 +2243,10 @@ size_t ECMA262Parser::ensure_total_number_of_capturing_parenthesis()
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
lexer.consume();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
lexer.consume();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_total_number_of_capturing_parenthesis = count;
|
m_total_number_of_capturing_parenthesis = count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue