Crates.io | eager |
lib.rs | eager |
version | 0.1.0 |
source | src |
created_at | 2018-07-07 21:31:15.67194 |
updated_at | 2018-07-07 21:31:15.67194 |
description | Crate for eager macro expansion. |
homepage | |
repository | https://github.com/Emoun/eager |
max_upload_size | |
id | 73256 |
size | 58,218 |
Rust crate for simulating eager macro expansion.
#[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!()});
}
Licensed under the MIT license.