1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#1136 in Rust patterns

Download history 20400/week @ 2023-12-11 20735/week @ 2023-12-18 11298/week @ 2023-12-25 18459/week @ 2024-01-01 22491/week @ 2024-01-08 20194/week @ 2024-01-15 23911/week @ 2024-01-22 17832/week @ 2024-01-29 20347/week @ 2024-02-05 13686/week @ 2024-02-12 19272/week @ 2024-02-19 19241/week @ 2024-02-26 20095/week @ 2024-03-04 21444/week @ 2024-03-11 23571/week @ 2024-03-18 20264/week @ 2024-03-25

86,937 downloads per month
Used in 549 crates (12 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