diff options
Diffstat (limited to 'src/macros.rs')
-rw-r--r-- | src/macros.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/macros.rs b/src/macros.rs index 87be7b4..7ea574c 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: Apache-2.0 OR MIT + macro_rules! ast_struct { ( [$($attrs_pub:tt)*] @@ -7,8 +9,8 @@ macro_rules! ast_struct { $($attrs_pub)* struct $name $($rest)* }; - ($($t:tt)*) => { - strip_attrs_pub!(ast_struct!($($t)*)); + ($($tt:tt)*) => { + strip_attrs_pub!(ast_struct!($($tt)*)); }; } @@ -21,8 +23,8 @@ macro_rules! ast_enum { $($attrs_pub)* enum $name $($rest)* ); - ($($t:tt)*) => { - strip_attrs_pub!(ast_enum!($($t)*)); + ($($tt:tt)*) => { + strip_attrs_pub!(ast_enum!($($tt)*)); }; } @@ -93,15 +95,14 @@ macro_rules! generate_to_tokens { } macro_rules! strip_attrs_pub { - ($mac:ident!($(#[$m:meta])* $pub:ident $($t:tt)*)) => { + ($mac:ident!($(#[$m:meta])* $pub:ident $($tt:tt)*)) => { check_keyword_matches!(pub $pub); - $mac!([$(#[$m])* $pub] $($t)*); + $mac!([$(#[$m])* $pub] $($tt)*); }; } macro_rules! check_keyword_matches { - (struct struct) => {}; (enum enum) => {}; (pub pub) => {}; } |