macro_rules! impl_enum_token {
($token_type:ident; $trait_name:ident; //
$(
$name:ident (
$(
$variant:ident => ($($str:expr),+)
$(,)?
)+
)
),+ $(,)?
) => { ... };
}Expand description
Macro to implement specific token types for a given trait.
This macro simplifies the creation of token structures that implement a common trait, allowing for polymorphic handling of different token types within the parsing logic.