third_party_rust_syn/dev/parse.rs
2020-06-09 20:46:54 -07:00

17 lines
370 B
Rust

use proc_macro::TokenStream;
use quote::quote;
use syn::File;
#[proc_macro]
pub fn r#mod(input: TokenStream) -> TokenStream {
let compile_error = syn::parse::<File>(input)
.map(|file| println!("{:#?}", file))
.map_err(|err| err.to_compile_error())
.err();
TokenStream::from(quote! {
#compile_error
fn main() {}
})
}