7 releases

0.1.0 Jan 10, 2022
0.0.5 Dec 20, 2021

#64 in #builder-pattern

MIT license

23KB
175 lines

module::wproc_macro

Tools for writing procedural macroses.

Sample

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

To add to your project

cargo add wproc_macro

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/wproc_macro_trivial
cargo run

lib.rs:

Tools for writing procedural macroses.

Dependencies

~1.5MB
~36K SLoC