rust/tests/source/macros.rs

82 lines
1.4 KiB
Rust
Raw Normal View History

// rustfmt-normalize_comments: true
2016-01-22 13:40:26 -06:00
itemmacro!(this, is.now() .formatted(yay));
2015-09-14 15:53:30 -05:00
2016-01-24 13:11:18 -06:00
itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());
itemmacro!{this, is.bracket().formatted()}
peg_file! modname ("mygrammarfile.rustpeg");
2015-09-14 15:53:30 -05:00
fn main() {
foo! ( );
bar!( a , b , c );
baz!(1+2+3, quux. kaas());
quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB);
kaas!(/* comments */ a /* post macro */, b /* another */);
trailingcomma!( a , b , c , );
noexpr!( i am not an expression, OK? );
vec! [ a , b , c];
vec! [AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA, AAAAAA,
BBBBB, 5, 100-30, 1.33, b, b, b];
vec! [a /* comment */];
// Trailing spaces after a comma
vec![
a,
];
unknown_bracket_macro__comma_should_not_be_stripped![
a,
];
2015-09-14 15:53:30 -05:00
foo(makro!(1, 3));
hamkaas!{ () };
macrowithbraces! {dont, format, me}
x!(fn);
some_macro!(
);
some_macro![
];
some_macro!{
// comment
};
some_macro!{
// comment
};
some_macro!(
// comment
not function like
);
}
impl X {
empty_invoc!{}
2015-09-14 15:53:30 -05:00
}
gfx_pipeline!(pipe {
vbuf: gfx::VertexBuffer<Vertex> = (),
out: gfx::RenderTarget<ColorFormat> = "Target0",
});
fn issue_1279() {
println!("dsfs"); // a comment
}