token

Macro token 

Source
macro_rules! token {
    ($(#[$attrs:meta])* $vis:vis enum $name:ident $(<
        $($lt:lifetime $(: $ltltbound:lifetime)?),* $(,)?
        $($T:ident $(: $bound:path)? $(: ?$sized:path)? $(: $ltbound:lifetime)? $(= $default:ty)?),* $(,)?
    >)? : $src:ty
    $(where $($U:ty $(: $whbound:path)? $(: ?$whsized:path)? $(: $whltbound:lifetime)?),* $(,)?)?
     {
        $(
            $(#[$f_attrs:meta])*
            $(@[$($key:ident = $value:ident),* $(,)?])?
            $var:ident $(($field:ty))? = $token:expr
        ),+ $(,)?
    }) => { ... };
}
Expand description

Generate enums represents tokens or syntax trees.

In this macro, each variants must be formed Self::Variant or Self::Variant(Type) and if a parameter exists, the parser output type should be Type.