diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-17 06:03:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-17 06:03:41 +0900 |
| commit | c81e9f89d9e4388f36a4427bbaa95eced659d2ce (patch) | |
| tree | cd35eedf6741347e791e6909ec604b89d5e0cff7 /crates/shirabe-symfony-console | |
| parent | ea39e2301824435d45db88f95867dbe692aaf21e (diff) | |
| download | php-shirabe-c81e9f89d9e4388f36a4427bbaa95eced659d2ce.tar.gz php-shirabe-c81e9f89d9e4388f36a4427bbaa95eced659d2ce.tar.zst php-shirabe-c81e9f89d9e4388f36a4427bbaa95eced659d2ce.zip | |
refactor(preg): split the PREG_UNMATCHED_AS_NULL preg_* by flag
preg_match2() and preg_match_all_offset_capture() each become a pair over
a shared private impl, and their flags arguments are gone: no caller passed
anything but 0 or PREG_UNMATCHED_AS_NULL. Preg::match5()/is_match5() lose
their own flags argument for the same reason -- both call sites passed 0,
and the value had nowhere left to go -- so they are renumbered to
match4()/is_match4(). PREG_UNMATCHED_AS_NULL itself is now unreferenced.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-symfony-console')
| -rw-r--r-- | crates/shirabe-symfony-console/src/formatter/output_formatter.rs | 1 | ||||
| -rw-r--r-- | crates/shirabe-symfony-console/src/input/string_input.rs | 5 |
2 files changed, 1 insertions, 5 deletions
diff --git a/crates/shirabe-symfony-console/src/formatter/output_formatter.rs b/crates/shirabe-symfony-console/src/formatter/output_formatter.rs index 6ce96875..1a3de217 100644 --- a/crates/shirabe-symfony-console/src/formatter/output_formatter.rs +++ b/crates/shirabe-symfony-console/src/formatter/output_formatter.rs @@ -296,7 +296,6 @@ impl WrappableOutputFormatterInterface for OutputFormatter { format!("#<(({open_tag_regex}) | /({close_tag_regex})?)>#ix"), message, &mut matches, - 0, ); let full_matches = matches .get(&CaptureKey::ByIndex(0)) diff --git a/crates/shirabe-symfony-console/src/input/string_input.rs b/crates/shirabe-symfony-console/src/input/string_input.rs index 1ec6e853..d6794957 100644 --- a/crates/shirabe-symfony-console/src/input/string_input.rs +++ b/crates/shirabe-symfony-console/src/input/string_input.rs @@ -58,7 +58,7 @@ impl StringInput { } let mut m: IndexMap<CaptureKey, Option<String>> = IndexMap::new(); - if preg_match2(php_regex!(r"/\s+/A"), input, &mut m, 0, cursor as usize) { + if preg_match2(php_regex!(r"/\s+/A"), input, &mut m, cursor as usize) { if token.is_some() { tokens.push(token.take().unwrap()); } @@ -68,7 +68,6 @@ impl StringInput { format!(r#"/([^="'\s]+?)(=?)({}+)/A"#, Self::REGEX_QUOTED_STRING), input, &mut m, - 0, cursor as usize, ) { let inner = shirabe_php_shim::substr( @@ -91,7 +90,6 @@ impl StringInput { format!(r"/{}/A", Self::REGEX_QUOTED_STRING), input, &mut m, - 0, cursor as usize, ) { token = Some(format!( @@ -109,7 +107,6 @@ impl StringInput { format!(r"/{}/A", Self::REGEX_UNQUOTED_STRING), input, &mut m, - 0, cursor as usize, ) { token = Some(format!( |
