diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 11:10:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 11:10:53 +0900 |
| commit | 66c3eba15ba6302d43de057a9063f7feee8c6fb3 (patch) | |
| tree | d44bf5cec4d9ddfffa1a732dba85418c2873de82 /crates/shirabe/src/json | |
| parent | 0b737de495e9a8530a6a32ce2799dc49f3e5786f (diff) | |
| download | php-shirabe-66c3eba15ba6302d43de057a9063f7feee8c6fb3.tar.gz php-shirabe-66c3eba15ba6302d43de057a9063f7feee8c6fb3.tar.zst php-shirabe-66c3eba15ba6302d43de057a9063f7feee8c6fb3.zip | |
refactor(pcre): extract composer/pcre into the shirabe-pcre crate
Move `Composer\Pcre` out of shirabe-external-packages and into its own
crate, so the path is `shirabe_pcre::preg::Preg` instead of
`shirabe_external_packages::composer::pcre::preg::Preg`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/json')
| -rw-r--r-- | crates/shirabe/src/json/json_file.rs | 10 | ||||
| -rw-r--r-- | crates/shirabe/src/json/json_manipulator.rs | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs index 4c74b83e..f506a831 100644 --- a/crates/shirabe/src/json/json_file.rs +++ b/crates/shirabe/src/json/json_file.rs @@ -9,8 +9,8 @@ use crate::util::Filesystem; use crate::util::HttpDownloader; use crate::util::Silencer; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_external_packages::seld::json_lint::{ParsingException, ParsingExceptionDetails}; +use shirabe_pcre::{CaptureKey, Preg}; use shirabe_php_shim::Catch as _; use shirabe_php_shim::{ InvalidArgumentException, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE, @@ -451,13 +451,9 @@ impl JsonFile { let indent_owned = options.indent; return Ok(Preg::replace_callback( php_regex!(r"#^ {4,}#m"), - move |m: &indexmap::IndexMap< - shirabe_external_packages::composer::pcre::CaptureKey, - String, - >| - -> String { + move |m: &indexmap::IndexMap<shirabe_pcre::CaptureKey, String>| -> String { let whole = m - .get(&shirabe_external_packages::composer::pcre::CaptureKey::ByIndex(0)) + .get(&shirabe_pcre::CaptureKey::ByIndex(0)) .map(|s| s.as_str()) .unwrap_or(""); str_repeat(&indent_owned, (strlen(whole) / 4) as usize) diff --git a/crates/shirabe/src/json/json_manipulator.rs b/crates/shirabe/src/json/json_manipulator.rs index d66fe645..5a77e771 100644 --- a/crates/shirabe/src/json/json_manipulator.rs +++ b/crates/shirabe/src/json/json_manipulator.rs @@ -4,7 +4,7 @@ use crate::json::JsonFile; use crate::json::json_grammar::{self, ValueKind}; use crate::repository::PlatformRepository; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; +use shirabe_pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ InvalidArgumentException, LogicException, PhpMixed, addcslashes, array_key_exists, array_keys, array_reverse, empty, explode, implode, in_array_loose, is_array, is_int, is_numeric, |
