1 unstable release

Uses old Rust 2015

0.1.0 Jul 7, 2018

#4 in #expansion

Download history 14470/week @ 2023-10-25 13241/week @ 2023-11-01 19203/week @ 2023-11-08 22215/week @ 2023-11-15 14926/week @ 2023-11-22 20136/week @ 2023-11-29 20823/week @ 2023-12-06 22594/week @ 2023-12-13 17826/week @ 2023-12-20 13180/week @ 2023-12-27 23397/week @ 2024-01-03 21207/week @ 2024-01-10 25571/week @ 2024-01-17 22301/week @ 2024-01-24 21007/week @ 2024-01-31 16365/week @ 2024-02-07

88,420 downloads per month
Used in 521 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