mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibRegex: Only skip full instructions when optimizing alternations
It makes no sense to skip half of an instruction, so make sure to skip only full instructions!
This commit is contained in:
parent
f0d2489254
commit
6a4c8a66ae
2 changed files with 8 additions and 1 deletions
|
@ -923,6 +923,8 @@ TEST_CASE(optimizer_atomic_groups)
|
|||
Tuple { "(a|)"sv, ""sv, true }, // Ensure that empty alternatives are not outright removed
|
||||
Tuple { "a{2,3}|a{5,8}"sv, "abc"sv, false }, // Optimizer should not mess up the instruction stream by ignoring inter-insn dependencies, see #11247.
|
||||
Tuple { "^(a{2,3}|a{5,8})$"sv, "aaaa"sv, false }, // Optimizer should not mess up the instruction stream by ignoring inter-insn dependencies, see #11247.
|
||||
// Optimizer should not chop off *half* of an instruction when fusing instructions.
|
||||
Tuple { "cubic-bezier\\(\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*,\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*,\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*,\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*\\)"sv, "cubic-bezier(.05, 0, 0, 1)"sv, true },
|
||||
// ForkReplace shouldn't be applied where it would change the semantics
|
||||
Tuple { "(1+)\\1"sv, "11"sv, true },
|
||||
Tuple { "(1+)1"sv, "11"sv, true },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue