wproc_macro

Crates.iowproc_macro
lib.rswproc_macro
version0.1.0
sourcesrc
created_at2021-12-06 08:12:03.10331
updated_at2022-01-10 14:49:25.01086
descriptionTools for writing procedural macroses.
homepagehttps://github.com/Wandalen/wTools/tree/master/module/rust/wproc_macro
repositoryhttps://github.com/Wandalen/wTools/tree/master/module/rust/wproc_macro
max_upload_size
id493092
size21,078
Wandalen (Wandalen)

documentation

https://docs.rs/wproc_macro

README

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
Commit count: 0

cargo fmt