macro_rules! to_tokens { ( $(#[$struct_attr:meta])* $struct_vis:vis struct $struct_name:ident {$( $(#[$field_attr:meta])* $field_vis:vis $field_name:ident : $field_ty:ty ),* $(,)?} ) => { ... }; ( $(#[$enum_attr:meta])* $enum_vis:vis enum $enum_name:ident {$( $(#[$variant_attr:meta])* $variant_name:ident ),+ $(,)?} ) => { ... }; }