diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-14 13:02:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-14 13:02:59 +0900 |
| commit | cfd2a4488797ddaabd0087aa0021b26892663ffb (patch) | |
| tree | ed2c030dded78355e0721d5458c2c6b12a3c2f2c /crates/shirabe/src/console/application.rs | |
| parent | c1070afe69f53b621adea232527080d2c922e1a9 (diff) | |
| download | php-shirabe-cfd2a4488797ddaabd0087aa0021b26892663ffb.tar.gz php-shirabe-cfd2a4488797ddaabd0087aa0021b26892663ffb.tar.zst php-shirabe-cfd2a4488797ddaabd0087aa0021b26892663ffb.zip | |
refactor(pcre): treat regex compile failure as fatal in shim
The preg_* shim helpers wrapped their results in Option/Result solely to
signal a regex that failed to compile. Composer never feeds a pattern
that fails at runtime, so such a failure is a programming error: panic
instead and drop the Option/Result wrappers, updating all callers.
preg_replace_callback keeps its Result return type since the callback
itself is fallible. preg_match_groups is removed in favor of preg_match
at its sole call site.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/console/application.rs')
| -rw-r--r-- | crates/shirabe/src/console/application.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/shirabe/src/console/application.rs b/crates/shirabe/src/console/application.rs index 4be2f90..ad0073f 100644 --- a/crates/shirabe/src/console/application.rs +++ b/crates/shirabe/src/console/application.rs @@ -2711,9 +2711,7 @@ impl Application { Some(&mut m), 0, offset as usize, - ) - .expect("invalid regex") - == 1 + ) == 1 { let m0 = m[&shirabe_php_shim::CaptureKey::ByIndex(0)] .as_deref() |
