diff options
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 8a737aa..3b80635 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -16,7 +16,11 @@ mod input; #[proc_macro_derive(Template, attributes(template))] pub fn derive_template(input: TokenStream) -> TokenStream { - generator::derive_template(input) + let ast = syn::parse::<syn::DeriveInput>(input).unwrap(); + match generator::build_template(&ast) { + Ok(source) => source.parse().unwrap(), + Err(e) => e.into_compile_error(), + } } #[derive(Debug, Clone)] |