Break up library into macros and map nested libraries for shared dependency with constant map macro.
This commit is contained in:
parent
805874a4c1
commit
d037e22164
8 changed files with 88 additions and 39 deletions
19
macros/src/lib.rs
Normal file
19
macros/src/lib.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extern crate proc_macro;
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
use syn::{parse_macro_input, DeriveInput};
|
||||
use quote::quote;
|
||||
|
||||
/// Example of [function-like procedural macro][1].
|
||||
///
|
||||
/// [1]: https://doc.rust-lang.org/reference/procedural-macros.html#function-like-procedural-macros
|
||||
#[proc_macro]
|
||||
pub fn map(input: TokenStream) -> TokenStream {
|
||||
let input = parse_macro_input!(input as DeriveInput);
|
||||
|
||||
let tokens = quote! {
|
||||
const
|
||||
};
|
||||
|
||||
tokens.into()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue