Initial commit to test proc func macro
This commit is contained in:
commit
0b56d77364
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/target
|
||||||
|
Cargo.lock
|
||||||
|
.env
|
12
Cargo.toml
Normal file
12
Cargo.toml
Normal 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
12
src/lib.rs
Normal 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
|
||||||
|
}
|
||||||
|
))
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user