From d3abdd53e0cc86cb41c0793ce99dbb21b89a4361 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 21 Jul 2026 06:03:24 +0800 Subject: feat(pathf): add foreign item support with is_foreign flag Add `AnalyzeItem::foreign()` and `AnalyzeItem::local()` constructors to distinguish items resolved via `use` imports from local definitions. Update `GroupPattern` to collect use imports at file and module levels, resolving `group!(TypeName)` against them. Migrate all pattern implementations to use the new constructors, and adjust `type_mapping_builder` to skip the file's own module prefix for foreign items. --- mingling_pathf/src/patterns/pack.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'mingling_pathf/src/patterns/pack.rs') diff --git a/mingling_pathf/src/patterns/pack.rs b/mingling_pathf/src/patterns/pack.rs index 9977111..76597ba 100644 --- a/mingling_pathf/src/patterns/pack.rs +++ b/mingling_pathf/src/patterns/pack.rs @@ -36,10 +36,7 @@ impl AnalyzePattern for PackPattern { // Top-level macro calls Item::Macro(m) => { if let Some(name) = try_extract_pack_name(m) { - items.push(AnalyzeItem { - module: String::new(), - item_name: name, - }); + items.push(AnalyzeItem::local(String::new(), name)); } } // Macro calls inside inline modules @@ -49,10 +46,7 @@ impl AnalyzePattern for PackPattern { if let Item::Macro(m) = n && let Some(name) = try_extract_pack_name(m) { - items.push(AnalyzeItem { - module: item_mod.ident.to_string(), - item_name: name, - }); + items.push(AnalyzeItem::local(item_mod.ident.to_string(), name)); } } } -- cgit