grw_derive 0.1.0

Derive macros for the grw graph rewriting library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod val;
mod methods;

use proc_macro::TokenStream;

#[proc_macro_derive(Val)]
pub fn derive_val(input: TokenStream) -> TokenStream {
    val::expand(input.into())
        .unwrap_or_else(|e| e.to_compile_error())
        .into()
}

#[proc_macro_attribute]
pub fn repl(_attr: TokenStream, input: TokenStream) -> TokenStream {
    methods::expand(input.into())
        .unwrap_or_else(|e| e.to_compile_error())
        .into()
}