Use extra attribute

This commit is contained in:
greg 2018-05-02 03:53:38 -07:00
parent 51cdedb9cc
commit e498e19ffc
3 changed files with 7 additions and 1 deletions

View File

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["greg <greg.shuflin@protonmail.com>"] authors = ["greg <greg.shuflin@protonmail.com>"]
[dependencies] [dependencies]
syn = "0.13.1" syn = { version = "0.13.1", features = ["full", "extra-traits"] }
quote = "0.5" quote = "0.5"
[lib] [lib]

View File

@ -17,6 +17,11 @@ pub fn print_a_thing(_input: TokenStream) -> TokenStream {
pub fn derive_programming_language_interface(input: TokenStream) -> TokenStream { pub fn derive_programming_language_interface(input: TokenStream) -> TokenStream {
let ast: DeriveInput = syn::parse(input).unwrap(); let ast: DeriveInput = syn::parse(input).unwrap();
let name = &ast.ident; let name = &ast.ident;
let attrs = &ast.attrs;
println!("ATTRS {:?}", attrs);
//let language_name = attrs.iter().find(
let tokens = quote! { let tokens = quote! {
impl ProgrammingLanguageInterface for #name { impl ProgrammingLanguageInterface for #name {

View File

@ -28,6 +28,7 @@ mod eval;
use self::typechecking::{TypeContext}; use self::typechecking::{TypeContext};
#[derive(ProgrammingLanguageInterface)] #[derive(ProgrammingLanguageInterface)]
#[LanguageName = "Schala"]
pub struct Schala { pub struct Schala {
state: eval::State<'static>, state: eval::State<'static>,
type_context: TypeContext type_context: TypeContext