diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index 0f16bec626e3..f5c7f60aec5d 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -16,9 +16,9 @@ import io::WriterUtil; import pipes::{port, chan, SharedChan}; -macro_rules! move_out { +macro_rules! move_out ( { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } } -} +) enum request { get_count, diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index 7b2930387f4c..2e074f1b4bab 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -12,9 +12,9 @@ import io::WriterUtil; import pipes::{port, PortSet, chan}; -macro_rules! move_out { +macro_rules! move_out ( { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } } -} +) enum request { get_count, diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index 3cc474df3425..db8894da587d 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -32,11 +32,11 @@ proto! pingpong_unbounded { } // This stuff should go in libcore::pipes -macro_rules! move_it { +macro_rules! move_it ( { $x:expr } => { let t <- *ptr::addr_of($x); t } -} +) -macro_rules! follow { +macro_rules! follow ( { $($message:path($($x: ident),+) -> $next:ident $e:expr)+ } => ( @@ -62,7 +62,7 @@ macro_rules! follow { _ => { fail } } ) -} +) fn switch(+endp: pipes::recv_packet_buffered, f: fn(+option) -> U) -> U { diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index 1fff4a72ca21..efad6ae92108 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -34,9 +34,9 @@ import comm::port; import comm::recv; import comm::send; -macro_rules! move_out { +macro_rules! move_out ( { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } } -} +) trait word_reader { fn read_word() -> option<~str>; diff --git a/src/test/run-pass/html-literals.rs b/src/test/run-pass/html-literals.rs index 5e935ab17dc6..80f283c4f2b1 100644 --- a/src/test/run-pass/html-literals.rs +++ b/src/test/run-pass/html-literals.rs @@ -15,13 +15,13 @@ left. */ -macro_rules! html { +macro_rules! html ( { $($body:tt)* } => ( parse_node!( []; []; $($body)* ) ) -} +) -macro_rules! parse_node { +macro_rules! parse_node ( { [:$head:ident ($(:$head_nodes:expr),*) $(:$tags:ident ($(:$tag_nodes:expr),*))*]; @@ -72,7 +72,7 @@ macro_rules! parse_node { ); { []; [:$e:expr]; } => ( $e ); -} +) fn main() { let page = html! ( diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs index e3f9e06efce6..69a7e557fdcf 100644 --- a/src/test/run-pass/macro-2.rs +++ b/src/test/run-pass/macro-2.rs @@ -9,12 +9,12 @@ fn main() { assert (mylambda!(y, y * 2)(8) == 16); - macro_rules! mylambda_tt{ + macro_rules! mylambda_tt( {$x:ident, $body:expr} => { fn f($x: int) -> int { return $body; }; f } - } + ) assert(mylambda_tt!(y, y * 2)(8) == 16) } diff --git a/src/test/run-pass/macro-3.rs b/src/test/run-pass/macro-3.rs index 4a5f7f9093cc..549d7d1aaf09 100644 --- a/src/test/run-pass/macro-3.rs +++ b/src/test/run-pass/macro-3.rs @@ -5,8 +5,8 @@ fn main() { assert (trivial!() == 16); - macro_rules! trivial_tt{ + macro_rules! trivial_tt( {} => {1*2*4*2*1} - } + ) assert(trivial_tt!() == 16); } diff --git a/src/test/run-pass/macro-by-example-1.rs b/src/test/run-pass/macro-by-example-1.rs index 64ed3a367ecd..65b3fe0ac59a 100644 --- a/src/test/run-pass/macro-by-example-1.rs +++ b/src/test/run-pass/macro-by-example-1.rs @@ -2,9 +2,9 @@ fn main() { #macro[[#apply[f, [x, ...]], f(x, ...)]]; - macro_rules! apply_tt{ + macro_rules! apply_tt( {$f:expr, ($($x:expr),*)} => {$f($($x),*)} - } + ) fn add(a: int, b: int) -> int { return a + b; } diff --git a/src/test/run-pass/macro-interpolation.rs b/src/test/run-pass/macro-interpolation.rs index a138fa1e18f9..38032e4ec521 100644 --- a/src/test/run-pass/macro-interpolation.rs +++ b/src/test/run-pass/macro-interpolation.rs @@ -1,5 +1,5 @@ -macro_rules! overly_complicated { +macro_rules! overly_complicated ( {$fnname:ident, $arg:ident, $ty:ty, $body:block, $val:expr, $pat:pat, $res:path} => { fn $fnname($arg: $ty) -> option<$ty> $body @@ -11,7 +11,7 @@ macro_rules! overly_complicated { } } -} +) fn main() { assert overly_complicated!(f, x, option, { return some(x); }, some(8u), some(y), y) == 8u diff --git a/src/test/run-pass/macro.rs b/src/test/run-pass/macro.rs index f13b403b2651..30622d598860 100644 --- a/src/test/run-pass/macro.rs +++ b/src/test/run-pass/macro.rs @@ -4,8 +4,8 @@ fn main() { #macro[[#m1[a], a * 4]]; assert (m1!(2) == 8); - macro_rules! m1tt { + macro_rules! m1tt ( {$a:expr} => {$a*4} - }; + ); assert(m1tt!(2) == 8); } diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index c5576f2dda7c..839c63df951f 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -32,9 +32,9 @@ proto! bank { } } -macro_rules! move_it { +macro_rules! move_it ( { $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } } -} +) fn switch(+endp: pipes::recv_packet, f: fn(+option) -> U) -> U { @@ -43,7 +43,7 @@ fn switch(+endp: pipes::recv_packet, fn move_it(-x: T) -> T { x } -macro_rules! follow { +macro_rules! follow ( { $($message:path$(($($x: ident),+))||* -> $next:ident $e:expr)+ } => ( @@ -54,7 +54,7 @@ macro_rules! follow { _ => { fail } } ); -} +) fn client_follow(+bank: bank::client::login) { import bank::*; diff --git a/src/test/run-pass/pipe-presentation-examples.rs b/src/test/run-pass/pipe-presentation-examples.rs index 39ec905b43e9..9758ce68dc45 100644 --- a/src/test/run-pass/pipe-presentation-examples.rs +++ b/src/test/run-pass/pipe-presentation-examples.rs @@ -8,7 +8,7 @@ import double_buffer::client::*; import double_buffer::give_buffer; -macro_rules! select_if { +macro_rules! select_if ( { $index:expr, $count:expr, @@ -48,9 +48,9 @@ macro_rules! select_if { } => { fail } -} +) -macro_rules! select { +macro_rules! select ( { $( $port:path => { $($message:path$(($($x: ident),+))dont_type_this* @@ -62,7 +62,7 @@ macro_rules! select { $($message$(($($x),+))dont_type_this* -> $next $e),+ ], )+) } -} +) // Types and protocols struct Buffer { diff --git a/src/test/run-pass/select-macro.rs b/src/test/run-pass/select-macro.rs index 777920c77e50..9521d6f12892 100644 --- a/src/test/run-pass/select-macro.rs +++ b/src/test/run-pass/select-macro.rs @@ -3,7 +3,7 @@ { // select! -macro_rules! select_if { +macro_rules! select_if ( { $index:expr, @@ -44,9 +44,9 @@ macro_rules! select_if { ) } }; -} +) -macro_rules! select { +macro_rules! select ( { $( $port:path => { $($message:path$(($($x: ident),+))dont_type_this* @@ -58,6 +58,6 @@ macro_rules! select { $(type_this $message$(($(x $x),+))dont_type_this* -> $next => { $e }),+ ])+) } -} +) }