From 4665fc94ab9508d115298dd988e2381354f46c01 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 14 Jul 2026 01:36:27 +0800 Subject: feat(picker): add core trait, types, and builder macro for argument parsing Implement the foundational `mingling_picker` library along with its companion `mingling_picker_macros` crate. The picker provides: - `Pickable` trait for parsing types from raw strings - `PickerResult` enum modeling parse outcomes - `Picker` struct for storing and indexing command-line arguments - `PickerRequirement` struct for declarative parameter definitions - `PickerPattern` family (1..32) of typed pattern structs via the `internal_repeat` proc macro - `req!` proc macro as a succinct builder for `PickerRequirement` Re-export `mingling_picker::macros::*` from the `mingling` crate when the `picker` feature is enabled, replacing the previous wildcard re-export of `mingling_macros`. --- mingling/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mingling') diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs index 76d73b6..bee6fbb 100644 --- a/mingling/src/lib.rs +++ b/mingling/src/lib.rs @@ -170,7 +170,7 @@ pub mod macros { pub use mingling_macros::suggest_enum; /// New Parser provided by the `picker` feature #[cfg(feature = "picker")] - pub use mingling_macros::*; + pub use mingling_picker::macros::*; } /// derive macro `EnumTag` @@ -222,10 +222,6 @@ pub mod res; /// use mingling::prelude::*; /// ``` pub mod prelude { - /// Re-export of the `Groupped` derive macro for grouping types. - pub use crate::Groupped; - /// Re-export of the `RenderResult` struct for outputting rendering result - pub use crate::RenderResult; /// Re-export of the `chain` macro for defining a chain of commands. pub use crate::macros::chain; /// Re-export of the `dispatcher` macro for routing commands. @@ -242,6 +238,10 @@ pub mod prelude { pub use crate::macros::pack_err; /// Re-export of the `renderer` macro for defining renderer functions. pub use crate::macros::renderer; + /// Re-export of the `Groupped` derive macro for grouping types. + pub use crate::Groupped; + /// Re-export of the `RenderResult` struct for outputting rendering result + pub use crate::RenderResult; /// Like `pack_err!` but also marks the type for structured output #[cfg(all(feature = "structural_renderer", feature = "extra_macros"))] pub use mingling_macros::pack_err_structural; -- cgit