1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

LibRegex: Preserve capture groups and matches across ForkReplace

This makes the (flawed) ForkStay inserted as a loop header unnecessary,
and finally fixes LibRegex rewriting weird loops in weird ways.
This commit is contained in:
Ali Mohammad Pur 2022-01-21 23:45:33 +03:30 committed by Linus Groh
parent bc20e4f71d
commit cd83325c7c
2 changed files with 2 additions and 10 deletions

View file

@ -449,6 +449,8 @@ Optional<bool> Matcher<Parser>::execute(MatchInput const& input, MatchState& sta
(*it) = state;
it->instruction_position = state.fork_at_position;
it->initiating_fork = *input.fork_to_replace;
it->capture_group_matches = state.capture_group_matches;
it->matches = state.matches;
found = true;
break;
}