mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
This introduces a new mechanism for evaluating lookbehind assertions by adding four new bytecode opcodes: SetStepBack, IncStepBack, CheckStepBack, and CheckSavedPosition. These opcodes replace the previous GoBack-based approach and enables correct handling of variable-length lookbehind patterns, where the match length cannot be known statically. Track lookbehind greediness in the parser and propagate it to bytecode generation. Allow controlled backtracking in lookbehind bodies while avoiding incorrect captures during step-back execution. Partially fix issue: #3459
23 lines
599 B
Plaintext
23 lines
599 B
Plaintext
Harness status: OK
|
|
|
|
Found 17 tests
|
|
|
|
13 Pass
|
|
4 Fail
|
|
Pass Alternations are tried left to right, with no backtracking into a lookbehind
|
|
Pass Back-references
|
|
Fail Back-references to captures inside the lookbehind
|
|
Fail Capturing matches
|
|
Fail Captures inside negative lookbehind
|
|
Pass Do not backtrack into a lookbehind
|
|
Pass Greedy loop
|
|
Pass Miscellaneous
|
|
Fail Mutual recursive capture/back references
|
|
Pass Negative lookbehinds
|
|
Pass Nested lookaround
|
|
Pass Simple fixed-length matches
|
|
Pass Sliced strings
|
|
Pass Start of line matches
|
|
Pass Sticky matches
|
|
Pass Variable-length matches
|
|
Pass Word boundary matches |