1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:47:36 +00:00

LibRegex: Reset capture group indices when resetting parser state

This commit is contained in:
AnotherTest 2021-04-05 06:25:36 +04:30 committed by Andreas Kling
parent 7b7cbcecdf
commit be0182d049

View file

@ -151,6 +151,11 @@ ALWAYS_INLINE void Parser::reset()
m_parser_state.current_token = m_parser_state.lexer.next();
m_parser_state.error = Error::NoError;
m_parser_state.error_token = { TokenType::Eof, 0, StringView(nullptr) };
m_parser_state.capture_group_minimum_lengths.clear();
m_parser_state.capture_groups_count = 0;
m_parser_state.named_capture_groups_count = 0;
m_parser_state.named_capture_group_minimum_lengths.clear();
m_parser_state.named_capture_groups.clear();
}
Parser::Result Parser::parse(Optional<AllOptions> regex_options)