Can you give an example of what the expanded code should look like, and what should be the corresponding values of macro parameters? At the moment I don't understand what is your expected result.
I think it isn't possible to reuse parameters from macro rules.
I created a procedural function like macro to bypass the problem...
Thank you for your assistance.
Just for fun I tried writing declarative macro based on your first preference. I couldn't think of a way to support arbitrary many 'template' expressions though. Playground