1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#1514 in Rust patterns

Download history 25797/week @ 2024-11-25 40606/week @ 2024-12-02 35852/week @ 2024-12-09 26620/week @ 2024-12-16 14468/week @ 2024-12-23 20255/week @ 2024-12-30 35830/week @ 2025-01-06 39298/week @ 2025-01-13 38837/week @ 2025-01-20 37581/week @ 2025-01-27 43914/week @ 2025-02-03 41658/week @ 2025-02-10 35200/week @ 2025-02-17 38449/week @ 2025-02-24 42054/week @ 2025-03-03 44269/week @ 2025-03-10

162,468 downloads per month
Used in 786 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