The idea is that every macro definition also defines a regular language.
matches!(
($enum:ident: $T:ty
$($variant:ident $(= $value:expr)*)+
)
Flags: uint
A = 1
B = 2
C = 3
)
// => true
- capture nonterminals.
- count sequence repetitons.
- write
macro_rules!