]> git.lizzy.rs Git - rust.git/blob - tests/source/macros.rs
3eee8c543ba709fa0294601e620d13e7c2508d13
[rust.git] / tests / source / macros.rs
1 // rustfmt-normalize_comments: true
2 itemmacro!(this, is.now() .formatted(yay));
3
4 itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());
5
6 itemmacro!{this, is.bracket().formatted()}
7
8 peg_file!   modname  ("mygrammarfile.rustpeg");
9
10 fn main() {
11     foo! ( );
12
13     bar!( a , b , c );
14
15     baz!(1+2+3, quux. kaas());
16
17     quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
18
19     kaas!(/* comments */ a /* post macro */, b /* another */);
20
21     trailingcomma!( a , b , c , );
22
23     noexpr!( i am not an expression, OK? );
24
25     vec! [ a , b , c];
26
27     vec! [AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA,
28           BBBBB, 5, 100-30, 1.33, b, b, b];
29
30     vec! [a /* comment */];
31
32     // Trailing spaces after a comma
33     vec![
34     a,   
35     ];
36     
37     unknown_bracket_macro__comma_should_not_be_stripped![
38     a,
39     ];
40     
41     foo(makro!(1,   3));
42
43     hamkaas!{ () };
44
45     macrowithbraces! {dont,    format, me}
46
47     x!(fn);
48
49     some_macro!(
50         
51     );
52
53     some_macro![
54     ];
55
56     some_macro!{
57         // comment
58     };
59
60     some_macro!{
61         // comment
62     };
63
64     some_macro!(
65         // comment
66         not function like
67     );
68 }
69
70 impl X {
71     empty_invoc!{}
72 }
73
74 gfx_pipeline!(pipe {
75     vbuf: gfx::VertexBuffer<Vertex> = (),
76     out: gfx::RenderTarget<ColorFormat> = "Target0",
77 });
78
79 fn issue_1279() {
80     println!("dsfs"); // a comment
81 }
82
83 fn issue_1555() {
84     let hello = &format!("HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
85                          "65454654654654654654654655464",
86                          "4");
87 }