2017-01-16 01:50:27 +00:00
|
|
|
// rustfmt-normalize_comments: true
|
2016-01-22 19:40:26 +00:00
|
|
|
itemmacro!(this, is.now() .formatted(yay));
|
2015-09-14 20:53:30 +00:00
|
|
|
|
2016-01-24 19:11:18 +00:00
|
|
|
itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted());
|
|
|
|
|
|
|
|
itemmacro!{this, is.bracket().formatted()}
|
|
|
|
|
2016-03-27 12:45:55 +00:00
|
|
|
peg_file! modname ("mygrammarfile.rustpeg");
|
|
|
|
|
2015-09-14 20:53:30 +00:00
|
|
|
fn main() {
|
|
|
|
foo! ( );
|
|
|
|
|
|
|
|
bar!( a , b , c );
|
|
|
|
|
2017-06-23 03:57:34 +00:00
|
|
|
bar!( a , b , c , );
|
|
|
|
|
2015-09-14 20:53:30 +00:00
|
|
|
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 04:42:15 +00:00
|
|
|
// Trailing spaces after a comma
|
|
|
|
vec![
|
|
|
|
a,
|
|
|
|
];
|
|
|
|
|
2017-05-19 10:25:53 +00:00
|
|
|
vec![a; b];
|
|
|
|
vec!(a; b);
|
|
|
|
vec!{a; b};
|
|
|
|
|
|
|
|
vec![a, b; c];
|
|
|
|
vec![a; b, c];
|
|
|
|
|
2017-05-21 23:50:46 +00: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 04:42:15 +00:00
|
|
|
unknown_bracket_macro__comma_should_not_be_stripped![
|
|
|
|
a,
|
|
|
|
];
|
|
|
|
|
2015-09-14 20:53:30 +00:00
|
|
|
foo(makro!(1, 3));
|
|
|
|
|
|
|
|
hamkaas!{ () };
|
|
|
|
|
|
|
|
macrowithbraces! {dont, format, me}
|
2015-10-28 06:41:32 +00:00
|
|
|
|
|
|
|
x!(fn);
|
2016-03-27 11:44:08 +00:00
|
|
|
|
|
|
|
some_macro!(
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
some_macro![
|
|
|
|
];
|
|
|
|
|
|
|
|
some_macro!{
|
|
|
|
// comment
|
|
|
|
};
|
|
|
|
|
|
|
|
some_macro!{
|
|
|
|
// comment
|
|
|
|
};
|
2016-10-03 04:11:49 +00:00
|
|
|
|
|
|
|
some_macro!(
|
|
|
|
// comment
|
|
|
|
not function like
|
|
|
|
);
|
2017-05-23 16:18:15 +00:00
|
|
|
|
2017-06-17 17:35:18 +00:00
|
|
|
// #1712
|
|
|
|
let image = gray_image!(
|
|
|
|
00, 01, 02;
|
|
|
|
10, 11, 12;
|
|
|
|
20, 21, 22);
|
|
|
|
|
2017-05-07 21:44:48 +00:00
|
|
|
// #1092
|
|
|
|
chain!(input, a:take!(max_size), || []);
|
2016-03-27 11:44:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl X {
|
|
|
|
empty_invoc!{}
|
2015-09-14 20:53:30 +00:00
|
|
|
}
|
2016-04-27 19:08:44 +00:00
|
|
|
|
2017-01-17 21:38:46 +00:00
|
|
|
fn issue_1279() {
|
|
|
|
println!("dsfs"); // a comment
|
|
|
|
}
|
2017-05-15 13:55:01 +00:00
|
|
|
|
|
|
|
fn issue_1555() {
|
|
|
|
let hello = &format!("HTTP/1.1 200 OK\r\nServer: {}\r\n\r\n{}",
|
|
|
|
"65454654654654654654654655464",
|
|
|
|
"4");
|
|
|
|
}
|
2017-05-28 02:41:16 +00:00
|
|
|
|
|
|
|
fn issue1178() {
|
|
|
|
macro_rules! foo {
|
|
|
|
(#[$attr:meta] $name:ident) => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
foo!(#[doc = "bar"] baz);
|
|
|
|
}
|
2017-06-23 03:57:34 +00:00
|
|
|
fn issue1739() {
|
|
|
|
sql_function!(add_rss_item,
|
|
|
|
add_rss_item_t,
|
|
|
|
(a: types::Integer,
|
|
|
|
b: types::Timestamptz,
|
|
|
|
c: types::Text,
|
|
|
|
d: types::Text,
|
|
|
|
e: types::Text));
|
|
|
|
|
|
|
|
w.slice_mut(s![.., init_size[1] - extreeeeeeeeeeeeeeeeeeeeeeeem..init_size[1], ..])
|
|
|
|
.par_map_inplace(|el| *el = 0.);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Put the following tests with macro invocations whose arguments cannot be parsed as expressioins
|
|
|
|
// at the end of the file for now.
|
|
|
|
|
|
|
|
// #1577
|
|
|
|
fn issue1577() {
|
|
|
|
let json = json!({
|
|
|
|
"foo": "bar",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx_pipeline!(pipe {
|
|
|
|
vbuf: gfx::VertexBuffer<Vertex> = (),
|
|
|
|
out: gfx::RenderTarget<ColorFormat> = "Target0",
|
|
|
|
});
|