1 unstable release
Uses old Rust 2015
0.1.0 | Jul 7, 2018 |
---|
#1136 in Rust patterns
86,937 downloads per month
Used in 549 crates
(12 directly)
38KB
669 lines
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.
lib.rs
:
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.