1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#1845 in Rust patterns

Download history 43315/week @ 2025-05-28 51305/week @ 2025-06-04 46196/week @ 2025-06-11 38692/week @ 2025-06-18 36414/week @ 2025-06-25 34980/week @ 2025-07-02 36717/week @ 2025-07-09 38220/week @ 2025-07-16 39686/week @ 2025-07-23 48176/week @ 2025-07-30 50320/week @ 2025-08-06 44589/week @ 2025-08-13 47455/week @ 2025-08-20 51664/week @ 2025-08-27 48669/week @ 2025-09-03 45675/week @ 2025-09-10

201,530 downloads per month
Used in 783 crates (18 directly)

MIT license

38KB
669 lines

This crate contians three macros used to simulate eager macro expansion:

  1. eager!: Eagerly expands any macro in its body.
  2. eager_macro_rules!: Used to declare macro that can be eagerly expanded with eager!.
  3. lazy!: Used in eager! to revert to lazy macro expansion.

See the each macro's documentation for details.


eager

Build Status

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.

No runtime deps