diff --git a/.idea/misc.xml b/.idea/misc.xml
index 197e36a..c6c4293 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -41,6 +41,8 @@
+
+
diff --git a/.idea/rust.iml b/.idea/rust.iml
index 6566c66..e27f61d 100644
--- a/.idea/rust.iml
+++ b/.idea/rust.iml
@@ -165,6 +165,14 @@
+
+
+
+
+
+
+
+
@@ -183,6 +191,7 @@
+
@@ -191,6 +200,7 @@
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3212679..7307ac7 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -14,23 +14,55 @@
-
-
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -60,14 +92,6 @@
@@ -167,14 +199,26 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -183,7 +227,7 @@
-
+
@@ -211,7 +255,7 @@
-
+
@@ -270,13 +314,13 @@
-
+
-
+
-
+
@@ -289,11 +333,11 @@
+
-
@@ -333,8 +377,8 @@
-
-
+
+
@@ -342,7 +386,7 @@
-
+
@@ -350,7 +394,7 @@
-
+
@@ -364,59 +408,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -807,8 +798,8 @@
-
-
+
+
@@ -820,5 +811,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hello_macro/Cargo.toml b/hello_macro/Cargo.toml
new file mode 100644
index 0000000..1624266
--- /dev/null
+++ b/hello_macro/Cargo.toml
@@ -0,0 +1,7 @@
+[package]
+name = "hello_macro"
+version = "0.1.0"
+authors = ["Timothy Warren "]
+edition = "2018"
+
+[dependencies]
diff --git a/hello_macro/hello_macro_derive/Cargo.toml b/hello_macro/hello_macro_derive/Cargo.toml
new file mode 100644
index 0000000..8c86149
--- /dev/null
+++ b/hello_macro/hello_macro_derive/Cargo.toml
@@ -0,0 +1,12 @@
+[package]
+name = "hello_macro_derive"
+version = "0.1.0"
+authors = ["Timothy Warren "]
+edition = "2018"
+
+[lib]
+proc-macro = true
+
+[dependencies]
+syn = "0.14.4"
+quote = "0.6.3"
diff --git a/hello_macro/hello_macro_derive/src/lib.rs b/hello_macro/hello_macro_derive/src/lib.rs
new file mode 100644
index 0000000..478b442
--- /dev/null
+++ b/hello_macro/hello_macro_derive/src/lib.rs
@@ -0,0 +1,27 @@
+extern crate proc_macro;
+
+use crate::proc_macro::TokenStream;
+use quote::quote;
+use syn;
+
+#[proc_macro_derive(HelloMacro)]
+pub fn hello_macro_derive(input: TokenStream) -> TokenStream {
+ // Construct a representation of Rust code as a syntax tree
+ // that we can manipulate
+ let ast = syn::parse(input).unwrap();
+
+ // Build the trait implementation
+ impl_hello_macro(&ast)
+}
+
+fn impl_hello_macro(ast: &syn::DeriveInput) -> TokenStream {
+ let name = &ast.ident;
+ let gen = quote! (
+ impl HelloMacro for #name {
+ fn hello_macro() {
+ println!("Hello, Macro! My name is {}", stringify!(#name));
+ }
+ }
+ );
+ gen.into()
+}
diff --git a/hello_macro/src/lib.rs b/hello_macro/src/lib.rs
new file mode 100644
index 0000000..6341758
--- /dev/null
+++ b/hello_macro/src/lib.rs
@@ -0,0 +1,20 @@
+
+
+pub trait HelloMacro {
+ fn hello_macro();
+}
+
+/// Simplified version of the vec! macro
+/// This is an example of a declarative macro
+#[macro_export] // This makes the macro usable
+macro_rules! vec {
+ ( $( $x:expr ),* ) => { // This matches the argument list
+ {
+ let mut temp_vec = Vec::new();
+ $(
+ temp_vec.push($x);
+ )*
+ temp_vec
+ }
+ };
+}
diff --git a/pancakes/Cargo.toml b/pancakes/Cargo.toml
new file mode 100644
index 0000000..09e6d59
--- /dev/null
+++ b/pancakes/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "pancakes"
+version = "0.1.0"
+authors = ["Timothy Warren "]
+edition = "2018"
+
+[dependencies]
+hello_macro = { path = "../hello_macro" }
+hello_macro_derive = { path = "../hello_macro/hello_macro_derive" }
diff --git a/pancakes/src/main.rs b/pancakes/src/main.rs
new file mode 100644
index 0000000..468c30a
--- /dev/null
+++ b/pancakes/src/main.rs
@@ -0,0 +1,9 @@
+use hello_macro::HelloMacro;
+use hello_macro_derive::HelloMacro;
+
+#[derive(HelloMacro)]
+struct Pancakes;
+
+fn main() {
+ Pancakes::hello_macro();
+}