Skip to content

Commit

Permalink
Inline strip_attrs_pub into ast_enum macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 31, 2023
1 parent abad220 commit 4b3be4d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ macro_rules! ast_struct {

macro_rules! ast_enum {
(
[$($attrs_pub:tt)*]
enum $name:ident $($rest:tt)*
$(#[$enum_attr:meta])*
$pub:ident $enum:ident $name:ident $body:tt
) => {
$($attrs_pub)* enum $name $($rest)*
};
check_keyword_matches!(pub $pub);
check_keyword_matches!(enum $enum);

($($t:tt)*) => {
strip_attrs_pub!(ast_enum!($($t)*));
$(#[$enum_attr])* $pub $enum $name $body
};
}

Expand Down

0 comments on commit 4b3be4d

Please sign in to comment.