1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#1462 in Rust patterns

Download history 21743/week @ 2024-03-14 20989/week @ 2024-03-21 26823/week @ 2024-03-28 62929/week @ 2024-04-04 30120/week @ 2024-04-11 27688/week @ 2024-04-18 24621/week @ 2024-04-25 23262/week @ 2024-05-02 22445/week @ 2024-05-09 20618/week @ 2024-05-16 18227/week @ 2024-05-23 25490/week @ 2024-05-30 25295/week @ 2024-06-06 24582/week @ 2024-06-13 25212/week @ 2024-06-20 20266/week @ 2024-06-27

100,022 downloads per month
Used in 588 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