commit 0b56d7736412001b53eee13b2a9434921713bcc3 Author: franklinblanco Date: Sat Aug 13 16:45:02 2022 -0400 Initial commit to test proc func macro diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3549fae --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +Cargo.lock +.env \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..373756a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "dev-macros" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +syn = "1.0" +quote = "1.0" \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..d69ab87 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,12 @@ +use proc_macro::TokenStream; +use quote::{quote}; + + +#[proc_macro] +pub fn nigga(_input: TokenStream) -> TokenStream { + TokenStream::from(quote!( + fn deez() -> i32 { + 122 + } + )) +} \ No newline at end of file