Macro macro_tools::tree_print
source · macro_rules! tree_print { ( $src :expr ) => { ... }; ( $( $src :expr ),+ $(,)? ) => { ... }; }
Expand description
Macro for diagnostics purpose to print both syntax tree and source code behind it with syntax tree.
§Basic use-case.
use macro_tools::prelude::*;
let code = qt!( std::collections::HashMap< i32, i32 > );
let tree_type = syn::parse2::< syn::Type >( code ).unwrap();
tree_print!( tree_type );