Hmm, letās see how they look nested in close quarters:
// nesting on the left
previously: $($($(a)* b)* c)*
now: $($($(a)()* b)()* c)()*
// nesting on the right
previously: $(c $(b $(a)*)*)*
now: $(c $(b $(a)()*)()*)()* // (ouch)
$(c $[b ${a}{}*][]*)()* // if we could customize the delimiters...
// (still ouch?)
and a āblock-styleā repetition, for people who like to format it that way:
($($Add:ident for $Type;)()*) => {
$(
impl $Add for $Type {
...
}
)()*
};
// or the "bunched-together egyptian style" sometimes used
($($Add:ident for $Type;)()*) => {$(
impl $Add for $Type {
...
}
)()*};
A piece of a terrible incremental muncher:
(
// Munch the options one at a time into the $opt list.
($b:expr) [$kind:tt ($($opt:tt)()*)]
#opts# [$($opt_tok:tt)()+] $($rest:tt)()* // find a [] tt
)
=> {arg_impl!{
($b) [$kind ($($opt)()* [$($opt_tok)()+] )] // append to end
#opts# $($rest)()* // check for another
}};
It doesnāt seem too bad except for the ānesting on the rightā example. Though if it occurred, I think I might like to see a ātoken streamā matcher ($x:ts or maybe $x:tts) that matches like $($x:tt)()*.