1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#1182 in Rust patterns

Download history 38509/week @ 2024-11-30 36984/week @ 2024-12-07 27084/week @ 2024-12-14 15368/week @ 2024-12-21 19034/week @ 2024-12-28 35302/week @ 2025-01-04 38051/week @ 2025-01-11 38897/week @ 2025-01-18 38138/week @ 2025-01-25 43704/week @ 2025-02-01 41318/week @ 2025-02-08 34904/week @ 2025-02-15 37961/week @ 2025-02-22 42847/week @ 2025-03-01 45859/week @ 2025-03-08 37045/week @ 2025-03-15

168,813 downloads per month
Used in 793 crates (13 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