Starting to write custom derive for ProgrammingLanguageInterface
This commit is contained in:
parent
5d69b530c5
commit
258e813a39
@ -4,6 +4,8 @@ version = "0.1.0"
|
||||
authors = ["greg <greg.shuflin@protonmail.com>"]
|
||||
|
||||
[dependencies]
|
||||
syn = "0.11.11"
|
||||
quote = "0.3.15"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
@ -1,5 +1,8 @@
|
||||
#![feature(proc_macro)]
|
||||
extern crate proc_macro;
|
||||
#[macro_use]
|
||||
extern crate quote;
|
||||
extern crate syn;
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
#[proc_macro]
|
||||
@ -7,6 +10,12 @@ pub fn print_a_thing(_input: TokenStream) -> TokenStream {
|
||||
"println!(\"Invoked from a proc macro\");".parse().unwrap()
|
||||
}
|
||||
|
||||
|
||||
#[proc_macro_derive(ProgrammingLanguageInterface)]
|
||||
pub fn derive_programming_language_interface(input: TokenStream) -> TokenStream {
|
||||
input
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user