mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibRegex: Reset capture group indices when resetting parser state
This commit is contained in:
parent
7b7cbcecdf
commit
be0182d049
Notes:
sideshowbarker
2024-07-18 20:46:45 +09:00
Author: https://github.com/alimpfard
Commit: be0182d049
Pull-request: https://github.com/SerenityOS/serenity/pull/6133
Issue: https://github.com/SerenityOS/serenity/issues/6131
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue