Crates.io | wproc_macro |
lib.rs | wproc_macro |
version | 0.1.0 |
source | src |
created_at | 2021-12-06 08:12:03.10331 |
updated_at | 2022-01-10 14:49:25.01086 |
description | Tools for writing procedural macroses. |
homepage | https://github.com/Wandalen/wTools/tree/master/module/rust/wproc_macro |
repository | https://github.com/Wandalen/wTools/tree/master/module/rust/wproc_macro |
max_upload_size | |
id | 493092 |
size | 21,078 |
Tools for writing procedural macroses.
let code = quote!( 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!( "{}", quote!( #e ) ) );
// < i8
// < i16
// < i32
cargo add wproc_macro
git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/wproc_macro_trivial
cargo run