Macro dmutil::eager_macro_rules [] [src]

macro_rules! eager_macro_rules {
    (
		$(#[$($metas:tt)*])*
		$macro_name:ident $dollar1:tt $id_1:ident $dollar2:tt $id_2:ident
		$($rules:tt => $expansions:tt);* $(;)*
	) => { ... };
}

Declares an eager!-enabled macro.

Usage

Works exactly as macro_rules!, except the following difference:

  • The name of the macro to be declared is given in the body as the first token.
  • Two identifiers must be given after the name of the macro. Each must be preceded by a '$' sign, and must not collide with any macro variable name used in any rule.

eager!-enabling

To eager!-enable the following macro:

This example is not tested
macro_rules! some_macro{
    ...
}

The whole above declaration must be changed to:

This example is not tested
eager_macro_rules! {
    some_macro $eager_1 $eager2
    ...
}

where ... is the list of rules that comprise the macro, and no macro variable is called $eager_1 or $eager_2. Additionally, no rule should accept @eager, as this could conflict with the implementation of eager!.