1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#631 in Rust patterns

Download history 3892/week @ 2022-11-27 4590/week @ 2022-12-04 4845/week @ 2022-12-11 4710/week @ 2022-12-18 1829/week @ 2022-12-25 3916/week @ 2023-01-01 5600/week @ 2023-01-08 4293/week @ 2023-01-15 5673/week @ 2023-01-22 6724/week @ 2023-01-29 6950/week @ 2023-02-05 7294/week @ 2023-02-12 6637/week @ 2023-02-19 7842/week @ 2023-02-26 6033/week @ 2023-03-05 5687/week @ 2023-03-12

26,864 downloads per month
Used in 318 crates (10 directly)

MIT license

38KB
669 lines

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.


lib.rs:

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.

No runtime deps