1 unstable release
Uses old Rust 2015
| 0.1.0 | Jul 7, 2018 |
|---|
#1845 in Rust patterns
201,530 downloads per month
Used in 783 crates
(18 directly)
38KB
669 lines
This crate contians three macros used to simulate eager macro expansion:
eager!: Eagerly expands any macro in its body.eager_macro_rules!: Used to declare macro that can be eagerly expanded witheager!.lazy!: Used ineager!to revert to lazy macro expansion.
See the each macro's documentation for details.
eager
Rust crate for simulating eager macro expansion.
Example
#[macro_use]
extern crate eager;
//Declare an eager macro
eager_macro_rules!{ $eager_1
macro_rules! plus_1{
()=>{+ 1};
}
}
fn main(){
// Use the macro inside an eager! call to expand it eagerly
assert_eq!(4, eager!{2 plus_1!() plus_1!()});
}
License
Licensed under the MIT license.