Can I repeat match in a Rust macro? I want to be able to do something like:
my_dsl! {
foo <other tokens>;
bar <other tokens>;
foo <other tokens>;
...
}
Basically, an arbitrary number of semicolon-delimited statement, and each statement is handled by different rules.
I know I can have several foo!()
, bar!()
macros - each per statement, but ideally I'd like to avoid that.
I was thinking if I can capture something like $($t:tt)*,
but excluding semicolon, and then delegate to other macros?