1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#1619 in Rust patterns

Download history 26633/week @ 2024-07-22 27103/week @ 2024-07-29 45861/week @ 2024-08-05 30018/week @ 2024-08-12 26294/week @ 2024-08-19 28123/week @ 2024-08-26 25384/week @ 2024-09-02 23005/week @ 2024-09-09 12417/week @ 2024-09-16 22086/week @ 2024-09-23 22681/week @ 2024-09-30 22764/week @ 2024-10-07 28224/week @ 2024-10-14 28206/week @ 2024-10-21 31204/week @ 2024-10-28 31982/week @ 2024-11-04

120,786 downloads per month
Used in 668 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