Interesting macro
This commit is contained in:
parent
20dd8f1dee
commit
de30a033ec
@ -4,7 +4,6 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
14
src/lib.rs
14
src/lib.rs
@ -1,10 +1,10 @@
|
|||||||
use proc_macro::TokenStream;
|
|
||||||
use quote::{quote};
|
|
||||||
|
|
||||||
|
macro_rules! test_macro {
|
||||||
|
($out_struct:path, $path:literal) => ( {
|
||||||
|
println!($path);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#[proc_macro]
|
fn _s() {
|
||||||
pub fn nigga(_input: TokenStream) -> TokenStream {
|
test_macro!(String, "a");
|
||||||
TokenStream::from(quote!(
|
|
||||||
122
|
|
||||||
))
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user