Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change calls of `proto!` to use parens.

  • Loading branch information...
commit 77e83d83a9a93188c3bb80ea2bb09f2e5fd2579f 1 parent c74a442
@paulstansifer paulstansifer authored
View
4 src/libcore/future.rs
@@ -134,11 +134,11 @@ fn with<A,B>(future: &Future<A>, blk: fn((&A)) -> B) -> B {
blk(v)
}
-proto! future_pipe {
+proto! future_pipe (
waiting:recv<T:send> {
completed(T) -> !
}
-}
+)
#[test]
fn test_from_value() {
View
12 src/libcore/pipes.rs
@@ -7,14 +7,14 @@ directions they can flow at any given point are determined by a
protocol. Below is an example protocol.
~~~
-proto! pingpong {
+proto! pingpong (
ping: send {
ping -> pong
}
pong: recv {
pong -> ping
}
-}
+)
~~~
The `proto!` syntax extension will convert this into a module called
@@ -893,11 +893,11 @@ fn spawn_service_recv<T: send, Tb: send>(
// Streams - Make pipes a little easier in general.
-proto! streamp {
+proto! streamp (
open:send<T: send> {
data(T) -> open<T>
}
-}
+)
/// A trait for things that can send multiple messages.
trait channel<T: send> {
@@ -1138,11 +1138,11 @@ impl<T: send, U: send, Left: selectable recv<T>, Right: selectable recv<U>>
}
}
-proto! oneshot {
+proto! oneshot (
oneshot:send<T:send> {
send(T) -> !
}
-}
+)
/// The send end of a oneshot pipe.
type chan_one<T: send> = oneshot::client::oneshot<T>;
View
4 src/libsyntax/ext/pipes.rs
@@ -3,14 +3,14 @@
This is frequently called the pipe compiler. It handles code such as...
~~~
-proto! pingpong {
+proto! pingpong (
ping: send {
ping -> pong
}
pong: recv {
pong -> ping
}
-}
+)
~~~
There are several components:
View
4 src/test/bench/msgsend-ring-pipes.rs
@@ -15,11 +15,11 @@ import std::time;
import pipes::recv;
-proto! ring {
+proto! ring (
num:send {
num(uint) -> num
}
-}
+)
fn macros() {
#macro[
View
8 src/test/bench/pingpong.rs
@@ -7,7 +7,7 @@ use std;
import pipes::{spawn_service, recv};
import std::time::precise_time_s;
-proto! pingpong {
+proto! pingpong (
ping: send {
ping -> pong
}
@@ -15,9 +15,9 @@ proto! pingpong {
pong: recv {
pong -> ping
}
-}
+)
-proto! pingpong_unbounded {
+proto! pingpong_unbounded (
ping: send {
ping -> pong
}
@@ -29,7 +29,7 @@ proto! pingpong_unbounded {
you_will_never_catch_me: send {
never_ever_ever -> you_will_never_catch_me
}
-}
+)
// This stuff should go in libcore::pipes
macro_rules! move_it (
View
4 src/test/bench/task-perf-word-count-generic.rs
@@ -142,7 +142,7 @@ mod map_reduce {
}
- proto! ctrl_proto {
+ proto! ctrl_proto (
open: send<K: copy send, V: copy send> {
find_reducer(K) -> reducer_response<K, V>,
mapper_done -> !
@@ -151,7 +151,7 @@ mod map_reduce {
reducer_response: recv<K: copy send, V: copy send> {
reducer(Chan<reduce_proto<V>>) -> open<K, V>
}
- }
+ )
enum reduce_proto<V: copy send> { emit_val(V), done, addref, release }
View
4 src/test/run-pass/issue-2834.rs
@@ -2,11 +2,11 @@
//
// xfail-test
-proto! streamp {
+proto! streamp (
open:send<T: send> {
data(T) -> open<T>
}
-}
+)
fn rendezvous() {
let (c, s) = streamp::init();
View
4 src/test/run-pass/issue-2930.rs
@@ -1,8 +1,8 @@
-proto! stream {
+proto! stream (
stream:send<T:send> {
send(T) -> stream<T>
}
-}
+)
fn main() {
let (bc, _bp) = stream::init();
View
4 src/test/run-pass/pipe-bank-proto.rs
@@ -11,7 +11,7 @@ type password = ~str;
type money = float;
type amount = float;
-proto! bank {
+proto! bank (
login:send {
login(username, password) -> login_response
}
@@ -30,7 +30,7 @@ proto! bank {
money(money) -> connected,
insufficient_funds -> connected
}
-}
+)
macro_rules! move_it (
{ $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } }
View
4 src/test/run-pass/pipe-detect-term.rs
@@ -9,11 +9,11 @@ import std::uv;
import pipes::{try_recv, recv};
-proto! oneshot {
+proto! oneshot (
waiting:send {
signal -> !
}
-}
+)
fn main() {
let iotask = uv::global_loop::get();
View
4 src/test/run-pass/pipe-peek.rs
@@ -4,11 +4,11 @@ use std;
import std::timer::sleep;
import std::uv;
-proto! oneshot {
+proto! oneshot (
waiting:send {
signal -> !
}
-}
+)
fn main() {
let (c, p) = oneshot::init();
View
4 src/test/run-pass/pipe-pingpong-proto.rs
@@ -2,7 +2,7 @@
// xfail-pretty
-proto! pingpong {
+proto! pingpong (
ping:send {
ping -> pong
}
@@ -10,7 +10,7 @@ proto! pingpong {
pong:recv {
pong -> ping
}
-}
+)
mod test {
import pipes::recv;
View
4 src/test/run-pass/pipe-presentation-examples.rs
@@ -71,7 +71,7 @@ struct Buffer {
drop { }
}
-proto! double_buffer {
+proto! double_buffer (
acquire:send {
request -> wait_buffer
}
@@ -83,7 +83,7 @@ proto! double_buffer {
release:send {
release(Buffer) -> acquire
}
-}
+)
// Code examples
fn render(_buffer: &Buffer) {
View
8 src/test/run-pass/pipe-select-macro.rs
@@ -1,13 +1,13 @@
// xfail-pretty
// Protocols
-proto! foo {
+proto! foo (
foo:recv {
do_foo -> foo
}
-}
+)
-proto! bar {
+proto! bar (
bar:recv {
do_bar(int) -> barbar,
do_baz(bool) -> bazbar,
@@ -20,7 +20,7 @@ proto! bar {
bazbar:send {
rebazbar -> bar
}
-}
+)
fn macros() {
include!("select-macro.rs");
View
8 src/test/run-pass/pipe-select.rs
@@ -7,17 +7,17 @@ import std::uv;
import pipes::{recv, select};
-proto! oneshot {
+proto! oneshot (
waiting:send {
signal -> !
}
-}
+)
-proto! stream {
+proto! stream (
stream:send<T:send> {
send(T) -> stream<T>
}
-}
+)
fn main() {
import oneshot::client::*;
View
4 src/test/run-pass/pipe-sleep.rs
@@ -5,11 +5,11 @@ import std::timer::sleep;
import std::uv;
import pipes::recv;
-proto! oneshot {
+proto! oneshot (
waiting:send {
signal -> !
}
-}
+)
fn main() {
import oneshot::client::*;
Please sign in to comment.
Something went wrong with that request. Please try again.