diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-18 01:57:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-18 01:57:02 +0900 |
| commit | 6aeda8b237fcbf7a56ca0e8c0fff415477d31d22 (patch) | |
| tree | 13942695ae0e7c749cfcdb12d5824daf7134c008 /scripts/plugin-stub-generator/src/NamePrinter.php | |
| parent | fed0a6e7ac361af9b963c1f62411b1a85478230c (diff) | |
| download | php-shirabe-6aeda8b237fcbf7a56ca0e8c0fff415477d31d22.tar.gz php-shirabe-6aeda8b237fcbf7a56ca0e8c0fff415477d31d22.tar.zst php-shirabe-6aeda8b237fcbf7a56ca0e8c0fff415477d31d22.zip | |
refactor(preg): make preg_match_all yield matches per occurrence
PHP's PREG_PATTERN_ORDER is column-oriented, but 7 of the 10 call sites
read it row-wise, rebuilding each occurrence by indexing every column at
the same offset. Return an iterator of PregMatches instead, which is also
what the set-order and offset-capture variants were carrying, so the
three functions collapse into one and PregMatchesAll,
PregMatchesAllWithOffsets, CaptureKey and preg_match_map! all go away.
The offset-capture call sites are served by the new PregMatches
get_offset/name_offset accessors.
The search stays eager: regex::Captures borrows only the subject, so the
matches outlive the pattern resolved for the call, and PHP's
preg_match_all is eager too.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'scripts/plugin-stub-generator/src/NamePrinter.php')
0 files changed, 0 insertions, 0 deletions
