summaryrefslogtreecommitdiffstats
path: root/plugin_derive
diff options
context:
space:
mode:
Diffstat (limited to 'plugin_derive')
-rw-r--r--plugin_derive/Cargo.toml11
-rw-r--r--plugin_derive/src/lib.rs27
2 files changed, 0 insertions, 38 deletions
diff --git a/plugin_derive/Cargo.toml b/plugin_derive/Cargo.toml
deleted file mode 100644
index 0b62f9f..0000000
--- a/plugin_derive/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "plugin_derive"
-version = "0.1.0"
-authors = ["Jokler <jokler.contact@gmail.com>"]
-
-[lib]
-proc-macro = true
-
-[dependencies]
-syn = "0.11.11"
-quote = "0.3.15"
diff --git a/plugin_derive/src/lib.rs b/plugin_derive/src/lib.rs
deleted file mode 100644
index 704d6ef..0000000
--- a/plugin_derive/src/lib.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-
-//! Provides the plugin derive macro
-
-extern crate proc_macro;
-extern crate syn;
-#[macro_use]
-extern crate quote;
-
-use proc_macro::TokenStream;
-
-#[proc_macro_derive(PluginName)]
-pub fn derive_plugin(data: TokenStream) -> TokenStream {
- let ast = syn::parse_derive_input(&data.to_string()).unwrap();
- let gen = expand_plugin(&ast);
- gen.parse().unwrap()
-}
-
-fn expand_plugin(ast: &syn::DeriveInput) -> quote::Tokens {
- let name = &ast.ident;
- quote! {
- impl PluginName for #name {
- fn name(&self) -> &str {
- stringify!(#name)
- }
- }
- }
-}