aboutsummaryrefslogtreecommitdiff
path: root/mingling_core
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-06-29 14:12:24 +0800
committer魏曹先生 <1992414357@qq.com>2026-06-29 14:12:24 +0800
commit2fa18e2190fb3c17892e13cb06d330e707dc05ec (patch)
tree9a8a64565ee98a84c64c8677951df94bf3aa7176 /mingling_core
parentfaae53e760743971c43800f6e6bc2fcbaec582b7 (diff)
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.
Diffstat (limited to 'mingling_core')
-rw-r--r--mingling_core/src/lib.rs17
1 files changed, 17 insertions, 0 deletions
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)
+ }
}