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 {'
|
2022-01-08 12:43:22 -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 {'
|
2022-01-08 12:43:22 -08:00
|
|
|
// @has - //pre '(<= #![no_std] #[cfg(feature = "alloc")] =>) => { ... };'
|
|
|
|
make_macro!(attributes #![no_std] #[cfg(feature = "alloc")]);
|
2022-01-08 12:39:47 -08:00
|
|
|
|
|
|
|
// @has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {'
|
2022-01-08 12:43:22 -08:00
|
|
|
// @has - //pre '(<= fn {} () { foo[0] } =>) => { ... };'
|
2022-01-08 12:39:47 -08:00
|
|
|
make_macro!(groups fn {}() {foo[0]});
|
2022-01-08 12:43:22 -08:00
|
|
|
|
2022-01-14 14:33:58 -08:00
|
|
|
// @snapshot macro_linebreak_pre macro_generated_macro/macro.linebreak.html //pre
|
2022-01-08 12:43:22 -08:00
|
|
|
make_macro!(linebreak 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28);
|