My goal is to take as input trait type.
my_test_macro!(Trait1, Trait2<Test1, Test2=Test3>)
What I tried so far was writing parser like this.
$( $ty:ident < $( $N:ident $(: $b0:ident $(+$b:ident)* )? ),* $($tname:ident=$ttype:ident),* > )+*
But it created local ambiguity.
error: local ambiguity: multiple parsing options: built-in NTs ident ('N') or ident ('tname').
You can use the
ty
orpath
metavariables, depending on what you want to do:See also: