2017-01-16 14:50:27 +13:00
|
|
|
// rustfmt-normalize_comments: true
|
2016-01-22 13:40:26 -06:00
|
|
|
itemmacro!(this, is.now().formatted(yay));
|
2015-09-14 22:53:30 +02:00
|
|
|
|
2016-01-24 13:11:18 -06:00
|
|
|
itemmacro!(really,
|
|
|
|
long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb()
|
|
|
|
.is
|
|
|
|
.formatted());
|
|
|
|
|
|
|
|
itemmacro!{this, is.bracket().formatted()}
|
|
|
|
|
2016-03-27 14:45:55 +02:00
|
|
|
peg_file! modname("mygrammarfile.rustpeg");
|
|
|
|
|
2015-09-14 22:53:30 +02: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 */];
|
|
|
|
|
2016-11-14 07:42:15 +03:00
|
|
|
// Trailing spaces after a comma
|
|
|
|
vec![a];
|
|
|
|
|
2017-05-19 19:25:53 +09:00
|
|
|
vec![a; b];
|
|
|
|
vec![a; b];
|
|
|
|
vec![a; b];
|
|
|
|
|
|
|
|
vec![a, b; c];
|
|
|
|
vec![a; b, c];
|
|
|
|
|
2017-05-22 08:50:46 +09:00
|
|
|
vec![a;
|
|
|
|
(|x| {
|
|
|
|
let y = x + 1;
|
|
|
|
let z = y + 1;
|
|
|
|
z
|
|
|
|
})(2)];
|
|
|
|
vec![a;
|
|
|
|
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx];
|
|
|
|
vec![a; unsafe { x + 1 }];
|
|
|
|
|
2016-11-14 07:42:15 +03:00
|
|
|
unknown_bracket_macro__comma_should_not_be_stripped![
|
|
|
|
a,
|
|
|
|
];
|
|
|
|
|
2015-09-14 22:53:30 +02:00
|
|
|
foo(makro!(1, 3));
|
|
|
|
|
|
|
|
hamkaas!{ () };
|
|
|
|
|
|
|
|
macrowithbraces! {dont, format, me}
|
2015-10-27 23:41:32 -07:00
|
|
|
|
|
|
|
x!(fn);
|
2016-03-27 13:44:08 +02:00
|
|
|
|
|
|
|
some_macro!();
|
|
|
|
|
|
|
|
some_macro![];
|
|
|
|
|
|
|
|
some_macro!{
|
|
|
|
// comment
|
|
|
|
};
|
|
|
|
|
|
|
|
some_macro!{
|
|
|
|
// comment
|
|
|
|
};
|
2016-10-03 14:11:49 +10:00
|
|
|
|
|
|
|
some_macro!(
|
|
|
|
// comment
|
|
|
|
not function like
|
|
|
|
);
|
2017-05-24 01:18:15 +09:00
|
|
|
|
|
|
|
// #1577
|
|
|
|
let json = json!({
|
|
|
|
"foo": "bar",
|
|
|
|
});
|
2017-05-08 06:44:48 +09:00
|
|
|
|
|
|
|
// #1092
|
|
|
|
chain!(input, a:take!(max_size), || []);
|
2016-03-27 13:44:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
impl X {
|
|
|
|
empty_invoc!{}
|
2015-09-14 22:53:30 +02:00
|
|
|
}
|
2016-04-28 07:08:44 +12:00
|
|
|
|
|
|
|
gfx_pipeline!(pipe {
|
|
|
|
vbuf: gfx::VertexBuffer<Vertex> = (),
|
|
|
|
out: gfx::RenderTarget<ColorFormat> = "Target0",
|
|
|
|
});
|
2017-01-18 10:38:46 +13:00
|
|
|
|
|
|
|
fn issue_1279() {
|
|
|
|
println!("dsfs"); // a comment
|
|
|
|
}
|
2017-05-15 22:55:01 +09:00
|
|
|
|
|
|
|
fn issue_1555() {
|
|
|
|
let hello = &format!("HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
|
|
|
|
"65454654654654654654654655464",
|
|
|
|
"4");
|
|
|
|
}
|
2017-05-28 11:41:16 +09:00
|
|
|
|
|
|
|
fn issue1178() {
|
|
|
|
macro_rules! foo {
|
|
|
|
(#[$attr:meta] $name:ident) => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
foo!(#[doc = "bar"] baz);
|
|
|
|
}
|