feat!(core): Use new AST structure
Derive Expr methods using a derive proc-macro. These macros are present in the `argus-derive` crate, but the traits are defined in `argus-core`
This commit is contained in:
parent
70c5a50d22
commit
1c79847a77
22 changed files with 958 additions and 702 deletions
18
argus-derive/src/lib.rs
Normal file
18
argus-derive/src/lib.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use proc_macro::{self, TokenStream};
|
||||
use syn::parse_macro_input;
|
||||
|
||||
mod expr;
|
||||
|
||||
use expr::{bool_expr_impl, num_expr_impl};
|
||||
|
||||
#[proc_macro_derive(BoolExpr)]
|
||||
pub fn bool_expr(input: TokenStream) -> TokenStream {
|
||||
let input = parse_macro_input!(input);
|
||||
bool_expr_impl(input)
|
||||
}
|
||||
|
||||
#[proc_macro_derive(NumExpr)]
|
||||
pub fn num_expr(input: TokenStream) -> TokenStream {
|
||||
let input = parse_macro_input!(input);
|
||||
num_expr_impl(input)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue