how rust macros use + separator?

Viewed 88

I wrote a macro:

macro_rules! test {
    ($trait:tt<$($param:literal)+>) => {
        {
            println!("{}", stringify!($($param)++));
        }
    };
}

for the $param repeat separator, I couldn't use the + char which is the repeat 'op'.

The output looks like 1 2 3 + but how can I make it be 1 + 2 + 3 instead?

0 Answers
Related