Skip to content

Commit

Permalink
Move generate_to_tokens into ast_enum_of_structs
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 15, 2024
1 parent d7e0143 commit 7ab886f
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ macro_rules! ast_enum_of_structs {
$(#[$enum_attr])* $pub $enum $name $body

ast_enum_of_structs_impl!($name $body);

#[cfg(feature = "printing")]
generate_to_tokens!(() tokens $name $body);
};
}

Expand All @@ -77,19 +80,6 @@ macro_rules! ast_enum_of_structs_impl {
$($(
ast_enum_from_struct!($name::$variant, $member);
)*)*

#[cfg(feature = "printing")]
generate_to_tokens! {
()
tokens
$name {
$(
$(#[cfg $cfg_attr])*
$(#[doc $($doc_attr)*])*
$variant $( ($member) )*,
)*
}
}
};
}

Expand Down

0 comments on commit 7ab886f

Please sign in to comment.