3 releases
0.1.2 | May 25, 2022 |
---|---|
0.1.1 | Jan 15, 2022 |
0.1.0 | Jan 15, 2022 |
#653 in Development tools
2,062 downloads per month
1MB
28K
SLoC
Module :: macro_tools
Tools for writing procedural macroses.
Sample
use macro_tools::*;
use macro_tools::dependencies::*;
use quote::quote;
fn main()
{
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 macro_tools
Dependencies
~2.5MB
~72K SLoC