Initial commit to test proc func macro

This commit is contained in:
franklinblanco 2022-08-13 16:45:02 -04:00
commit 0b56d77364
3 changed files with 27 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/target
Cargo.lock
.env

12
Cargo.toml Normal file
View File

@ -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"

12
src/lib.rs Normal file
View File

@ -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
}
))
}