Crates.io | proc_macro_tools |
lib.rs | proc_macro_tools |
version | 0.1.17 |
source | src |
created_at | 2022-01-15 16:10:28.042567 |
updated_at | 2022-07-18 03:13:42.556166 |
description | Tools for writing procedural macroses. |
homepage | https://github.com/Wandalen/wTools/tree/master/module/rust/proc_macro_tools |
repository | https://github.com/Wandalen/wTools/tree/master/module/rust/proc_macro_tools |
max_upload_size | |
id | 514395 |
size | 983,953 |
Tools for writing procedural macroses.
#[ cfg( feature = "use_std" ) ]
{
use proc_macro_tools::*;
let code = qt!( core::option::Option< i8, i16, i32, i64 > );
let tree_type = syn::parse2::< syn::Type >( code ).unwrap();
let got = type_parameters( &tree_type, 0..=2 );
got.iter().for_each( | e | println!( "{}", qt!( #e ) ) );
/* print :
i8
i16
i32
*/
}
cargo add proc_macro_tools
git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/proc_macro_tools_trivial
cargo run