2018-04-27 02:19:09 -07:00
|
|
|
#![feature(proc_macro)]
|
|
|
|
extern crate proc_macro;
|
2018-04-30 00:35:42 -07:00
|
|
|
#[macro_use]
|
|
|
|
extern crate quote;
|
|
|
|
extern crate syn;
|
2018-04-27 02:19:09 -07:00
|
|
|
use proc_macro::TokenStream;
|
|
|
|
|
|
|
|
#[proc_macro]
|
|
|
|
pub fn print_a_thing(_input: TokenStream) -> TokenStream {
|
|
|
|
"println!(\"Invoked from a proc macro\");".parse().unwrap()
|
|
|
|
}
|
|
|
|
|
2018-04-30 00:35:42 -07:00
|
|
|
|
|
|
|
#[proc_macro_derive(ProgrammingLanguageInterface)]
|
|
|
|
pub fn derive_programming_language_interface(input: TokenStream) -> TokenStream {
|
|
|
|
input
|
|
|
|
}
|
|
|
|
|
2018-04-27 02:19:09 -07:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
#[test]
|
|
|
|
fn it_works() {
|
|
|
|
assert_eq!(2 + 2, 4);
|
|
|
|
}
|
|
|
|
}
|