]> git.lizzy.rs Git - rust.git/blob - rustfmt-core/tests/source/macro_rules.rs
7d14f44971d5827f8d1f5f5ebcec2cfc9d23e802
[rust.git] / rustfmt-core / tests / source / macro_rules.rs
1 macro_rules! m {
2         // a
3         ($expr :expr,  $( $func : ident    ) *   ) => {
4                 {
5                 let    x =    $expr;
6                                                                                         $func (
7                                                                                                                 x
8                                                                                         )
9         }
10         };
11
12                                 /* b */
13
14         ()           => {/* c */};
15
16                                                 (@tag)   =>
17                                                  {
18
19                                                  };
20
21 // d
22 ( $item:ident  ) =>      {
23         mod macro_item    {  struct $item ; }
24 };
25 }
26
27 macro m2 {
28         // a
29         ($expr :expr,  $( $func : ident    ) *   ) => {
30                 {
31                 let    x =    $expr;
32                                                                                         $func (
33                                                                                                                 x
34                                                                                         )
35         }
36         }
37
38                                 /* b */
39
40         ()           => {/* c */}
41
42                                                 (@tag)   =>
43                                                  {
44
45                                                  }
46
47 // d
48 ( $item:ident  ) =>      {
49         mod macro_item    {  struct $item ; }
50 }
51 }