From 2fa18e2190fb3c17892e13cb06d330e707dc05ec Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 29 Jun 2026 14:12:24 +0800 Subject: feat(pathf): add dispatch tree config and pass feature to analyzer Add `PathfinderConfig` struct to control dispatch tree extraction, and wire `use_dispatch_tree` through `DispatcherPattern`, `init_with_config`, and `analyze_and_build_type_mapping_for`. Expose config and wrapper from `mingling_core` under the `pathf` feature. --- mingling_core/src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mingling_core/src') diff --git a/mingling_core/src/lib.rs b/mingling_core/src/lib.rs index d49fa7f..14559ed 100644 --- a/mingling_core/src/lib.rs +++ b/mingling_core/src/lib.rs @@ -97,7 +97,24 @@ pub mod core_res { #[cfg(feature = "pathf")] pub mod pathf { + pub use mingling_pathf::config::*; pub use mingling_pathf::module_pathf::*; pub use mingling_pathf::pattern_analyzer::*; pub use mingling_pathf::patterns::*; + + pub use mingling_pathf::analyze_and_build_type_mapping; + + use std::path::Path; + + /// Wraps `analyze_and_build_type_mapping_for` with config derived from + /// the crate's feature flags (e.g., `dispatch_tree`). + pub fn analyze_and_build_type_mapping_for( + crate_dir: &Path, + output_dir: &Path, + ) -> Result<(), crate::error::MinglingPathfinderError> { + let config = mingling_pathf::config::PathfinderConfig { + use_dispatch_tree: cfg!(feature = "dispatch_tree"), + }; + mingling_pathf::analyze_and_build_type_mapping_for(crate_dir, output_dir, &config) + } } -- cgit