LibRegex: Don't treat single-jump blocks as noop in the optimizer

This commit is contained in:
Ali Mohammad Pur 2025-03-09 02:37:02 +01:00 committed by Ali Mohammad Pur
commit 5355710481
Notes: github-actions[bot] 2025-03-09 13:38:58 +00:00
2 changed files with 77 additions and 5 deletions

View file

@ -1074,6 +1074,8 @@ TEST_CASE(optimizer_atomic_groups)
Tuple { "(b+)(b+)"sv, "bbb"sv, true },
// Don't treat [\S] as [\s]; see ladybird#2296.
Tuple { "([^\\s]+?)\\(([\\s\\S]*)\\)"sv, "a(b)"sv, true },
// Follow direct jumps in the optimizer instead of assuming they're a noop.
Tuple { "(|[^]*)\\)"sv, "p)"sv, true },
};
for (auto& test : tests) {