2022-01-08 12:39:47 -08:00
|
|
|
macro_rules! make_macro {
|
|
|
|
|
($macro_name:ident $($matcher:tt)*) => {
|
2021-12-28 13:52:33 -08:00
|
|
|
#[macro_export]
|
2022-01-08 12:39:47 -08:00
|
|
|
macro_rules! $macro_name {
|
2021-12-28 13:52:33 -08:00
|
|
|
(<= $($matcher)* =>) => {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-08 12:39:47 -08:00
|
|
|
// @has macro_generated_macro/macro.interpolations.html //pre 'macro_rules! interpolations {'
|
2021-12-28 13:52:33 -08:00
|
|
|
// @has - //pre '(<= type $($i : ident) :: * + $e : expr =>) => { ... };'
|
2022-01-08 12:39:47 -08:00
|
|
|
make_macro!(interpolations type $($i:ident)::* + $e:expr);
|
|
|
|
|
interpolations!(<= type foo::bar + x.sort() =>);
|
2021-12-28 13:52:33 -08:00
|
|
|
|
2022-01-08 12:39:47 -08:00
|
|
|
// @has macro_generated_macro/macro.attributes.html //pre 'macro_rules! attributes {'
|
|
|
|
|
// @has - //pre '(<= #! [no_std] #[inline] =>) => { ... };'
|
|
|
|
|
make_macro!(attributes #![no_std] #[inline]);
|
|
|
|
|
|
|
|
|
|
// @has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {'
|
|
|
|
|
// @has - //pre '(<= fn {} () { foo [0] } =>) => { ... };'
|
|
|
|
|
make_macro!(groups fn {}() {foo[0]});
|