diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-13 21:19:03 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-13 21:19:03 +0800 |
| commit | 17cf59fe8220ac5befbbe8333fa0515ab532103d (patch) | |
| tree | c2470e6ecc44a74fc40eef8b5bc36901b9e939c6 /mingling_macros/src/lib.rs | |
| parent | b4cef6e601777b8c4b18df118689f8ac310fa835 (diff) | |
Remove comp module and add EnumTag derive macro
Diffstat (limited to 'mingling_macros/src/lib.rs')
| -rw-r--r-- | mingling_macros/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mingling_macros/src/lib.rs b/mingling_macros/src/lib.rs index f97c458..a989ce3 100644 --- a/mingling_macros/src/lib.rs +++ b/mingling_macros/src/lib.rs @@ -15,6 +15,7 @@ mod chain; #[cfg(feature = "comp")] mod completion; mod dispatcher_chain; +mod enum_tag; mod groupped; mod node; mod pack; @@ -98,6 +99,11 @@ pub fn derive_groupped(input: TokenStream) -> TokenStream { groupped::derive_groupped(input) } +#[proc_macro_derive(EnumTag, attributes(enum_desc))] +pub fn derive_enum_tag(input: TokenStream) -> TokenStream { + enum_tag::derive_enum_tag(input) +} + #[cfg(feature = "general_renderer")] #[proc_macro_derive(GrouppedSerialize, attributes(group))] pub fn derive_groupped_serialize(input: TokenStream) -> TokenStream { @@ -343,6 +349,12 @@ pub fn suggest(input: TokenStream) -> TokenStream { suggest::suggest(input) } +#[cfg(feature = "comp")] +#[proc_macro] +pub fn suggest_enum(input: TokenStream) -> TokenStream { + suggest::suggest_enum(input) +} + fn read_name(input: &TokenStream) -> Ident { if input.is_empty() { Ident::new("ThisProgram", proc_macro2::Span::call_site()) |
