]> git.lizzy.rs Git - rust.git/blob - tests/target/macros.rs
Preserve macro formatting if we can't rewrite it
[rust.git] / tests / target / macros.rs
1 itemmacro!(this, is.now().formatted(yay));
2
3 itemmacro!(really,
4            long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
5                .is
6                .formatted());
7
8 itemmacro!{this, is.bracket().formatted()}
9
10 peg_file! modname("mygrammarfile.rustpeg");
11
12 fn main() {
13     foo!();
14
15     bar!(a, b, c);
16
17     baz!(1 + 2 + 3, quux.kaas());
18
19     quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
20           BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
21
22     kaas!(// comments
23           a, // post macro
24           b /* another */);
25
26     trailingcomma!( a , b , c , );
27
28     noexpr!( i am not an expression, OK? );
29
30     vec![a, b, c];
31
32     vec![AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, BBBBB, 5,
33          100 - 30, 1.33, b, b, b];
34
35     vec![a /* comment */];
36
37     foo(makro!(1, 3));
38
39     hamkaas!{ () };
40
41     macrowithbraces! {dont,    format, me}
42
43     x!(fn);
44
45     some_macro!();
46
47     some_macro![];
48
49     some_macro!{
50         // comment
51     };
52
53     some_macro!{
54         // comment
55     };
56
57     some_macro!(
58         // comment
59         not function like
60     );
61 }
62
63 impl X {
64     empty_invoc!{}
65 }
66
67 gfx_pipeline!(pipe {
68     vbuf: gfx::VertexBuffer<Vertex> = (),
69     out: gfx::RenderTarget<ColorFormat> = "Target0",
70 });