aboutsummaryrefslogtreecommitdiff
path: root/mingling_pathf/src/pattern_analyzer.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-28 19:10:17 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-28 19:10:17 +0800
commitbf35af6bbf30492bcd23eb6103fdac3382dd6d33 (patch)
treedb4485c91a78ce1219f9c7774a2988ccce2897be /mingling_pathf/src/pattern_analyzer.rs
parent045c6aab213aadf4dbb66270ec0d203d7ec762a6 (diff)
refactor(pathf): move type resolution from compile-time to build-time
Diffstat (limited to 'mingling_pathf/src/pattern_analyzer.rs')
-rw-r--r--mingling_pathf/src/pattern_analyzer.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/mingling_pathf/src/pattern_analyzer.rs b/mingling_pathf/src/pattern_analyzer.rs
index 5b25c15..e88d9f6 100644
--- a/mingling_pathf/src/pattern_analyzer.rs
+++ b/mingling_pathf/src/pattern_analyzer.rs
@@ -50,6 +50,8 @@ pub struct AnalyzeItem {
pub item_name: String,
/// Whether the item is from an external crate (resolved via `use`), bypassing the file's own module path.
pub is_foreign: bool,
+ /// When `true`, this item is a module whose contents should be glob-imported (`::*`).
+ pub is_module: bool,
}
impl AnalyzeItem {
@@ -59,6 +61,17 @@ impl AnalyzeItem {
module,
item_name,
is_foreign: false,
+ is_module: false,
+ }
+ }
+
+ /// Creates a local module item — generates a `use path::item_name::*;` glob import.
+ pub fn local_module(module: String, item_name: String) -> Self {
+ Self {
+ module,
+ item_name,
+ is_foreign: false,
+ is_module: true,
}
}
@@ -68,6 +81,7 @@ impl AnalyzeItem {
module,
item_name,
is_foreign: true,
+ is_module: false,
}
}
}