17 releases

0.1.17 Jul 18, 2022
0.1.16 Jul 17, 2022
0.1.7 Jun 29, 2022
0.1.4 May 31, 2022
0.1.0 Jan 15, 2022

#1163 in Development tools

Download history 100/week @ 2022-11-28 170/week @ 2022-12-05 230/week @ 2022-12-12 780/week @ 2022-12-19 492/week @ 2022-12-26 82/week @ 2023-01-02 321/week @ 2023-01-09 750/week @ 2023-01-16 616/week @ 2023-01-23 700/week @ 2023-01-30 709/week @ 2023-02-06 367/week @ 2023-02-13 1214/week @ 2023-02-20 455/week @ 2023-02-27 326/week @ 2023-03-06 1625/week @ 2023-03-13

3,723 downloads per month
Used in 63 crates (6 directly)

MIT license

2.5MB
74K SLoC

Module :: proc_macro_tools

experimental rust-status docs.rs Open in Gitpod discord

Tools for writing procedural macroses.

Sample

#[ 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
  */
}

To add to your project

cargo add proc_macro_tools

Try out from the repository

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

Dependencies