From 2337aa8225b1452e2ec65c122e4b6e8b54f3ea7e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 17 Aug 2026 04:45:47 +0900 Subject: refactor(pcre): drop the guards for unsupported preg flags Preg::match5() rejected PREG_OFFSET_CAPTURE and check_set_order() rejected PREG_SET_ORDER, mirroring the PHP where those flags would change the type of $matches. The Rust ports of both take a typed `matches` out-param instead, so neither flag can reach them; check_set_order() already had no caller. The three constants are unreferenced once the guards are gone. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/src/preg.rs | 3 --- 1 file changed, 3 deletions(-) (limited to 'crates/shirabe-php-shim') diff --git a/crates/shirabe-php-shim/src/preg.rs b/crates/shirabe-php-shim/src/preg.rs index 6d70c717..62ad464c 100644 --- a/crates/shirabe-php-shim/src/preg.rs +++ b/crates/shirabe-php-shim/src/preg.rs @@ -1,9 +1,6 @@ use indexmap::IndexMap; use std::sync::{Arc, LazyLock, Mutex}; -pub const PREG_PATTERN_ORDER: i64 = 1; -pub const PREG_SET_ORDER: i64 = 2; -pub const PREG_OFFSET_CAPTURE: i64 = 256; pub const PREG_UNMATCHED_AS_NULL: i64 = 512; #[derive(Debug, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)] -- cgit v1.3.1-4-g156e