More autoderive things

This commit is contained in:
greg 2018-04-30 02:24:21 -07:00
parent 258e813a39
commit 491face68b
2 changed files with 11 additions and 3 deletions

View File

@ -4,8 +4,8 @@ version = "0.1.0"
authors = ["greg <greg.shuflin@protonmail.com>"]
[dependencies]
syn = "0.11.11"
quote = "0.3.15"
syn = "0.13.1"
quote = "0.5"
[lib]
proc-macro = true

View File

@ -3,7 +3,9 @@ extern crate proc_macro;
#[macro_use]
extern crate quote;
extern crate syn;
use proc_macro::TokenStream;
use syn::DeriveInput;
#[proc_macro]
pub fn print_a_thing(_input: TokenStream) -> TokenStream {
@ -13,7 +15,13 @@ pub fn print_a_thing(_input: TokenStream) -> TokenStream {
#[proc_macro_derive(ProgrammingLanguageInterface)]
pub fn derive_programming_language_interface(input: TokenStream) -> TokenStream {
input
let ast: DeriveInput = syn::parse(input).unwrap();
let name = &ast.ident;
let tokens = quote! {
impl ProgrammingLanguageInterface for #name {
}
};
tokens.into()
}
#[cfg(test)]