Skip to content

Commit dc2eab3

Browse files
committed
macros: Add parentheses in repetition test case
1 parent 08b7516 commit dc2eab3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
macro_rules! add_parens {
2+
($($rep:ident ( ) )*) => {
3+
{ 0 $(+ $rep ( ))* }
4+
};
5+
}
6+
7+
fn f() -> i32 {
8+
1
9+
}
10+
11+
fn main() -> i32 {
12+
let a = add_parens!(f() f() f());
13+
14+
a - 3
15+
}

0 commit comments

Comments
 (0)