Add a feature for printing the macro's generated code (#212)

This commit is contained in:
Nick Fitzgerald
2018-05-25 16:17:54 -07:00
committed by Alex Crichton
parent 4c27c349ea
commit 50b8842b95
3 changed files with 8 additions and 1 deletions

4
crates/macro/src/lib.rs Normal file → Executable file
View File

@ -20,7 +20,9 @@ pub fn wasm_bindgen(attr: TokenStream, input: TokenStream) -> TokenStream {
program.push_item(item, Some(opts), &mut ret);
program.to_tokens(&mut ret);
// println!("{}", ret);
if cfg!(feature = "xxx_debug_only_print_generated_code") {
println!("{}", ret);
}
ret.into()
}