about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-01-10 06:49:15 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-01-10 13:31:06 -0800
commit8b911587dfed1cc1973b361865c3632a2e2cffde (patch)
tree7a0be45d1690d5ccc80a23e80243f20076bf93eb /src/comp/syntax
parentaf086aa8ef0628cc21d4dc5831258bf45c9bb872 (diff)
downloadrust-8b911587dfed1cc1973b361865c3632a2e2cffde.tar.gz
rust-8b911587dfed1cc1973b361865c3632a2e2cffde.zip
rename sendfn to fn~, lambda to fn@
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/ast.rs8
-rw-r--r--src/comp/syntax/parse/parser.rs17
-rw-r--r--src/comp/syntax/print/pprust.rs4
3 files changed, 16 insertions, 13 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index 1acbabd65f9..1c053b4ed1a 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -111,10 +111,10 @@ tag pat_ {
 tag mutability { mut; imm; maybe_mut; }
 
 tag proto {
-    proto_bare;
-    proto_send;
-    proto_shared;
-    proto_block;
+    proto_bare;    // fn
+    proto_uniq;    // fn~
+    proto_box;     // fn@
+    proto_block;   // block
 }
 
 tag binop {
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 77a1df8d437..92efa7bbd82 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -514,10 +514,10 @@ fn parse_ty(p: parser, colons_before_params: bool) -> @ast::ty {
         t = parse_ty_fn(proto, p);
     } else if eat_word(p, "block") {
         t = parse_ty_fn(ast::proto_block, p);
-    } else if eat_word(p, "fn@") {
-        t = parse_ty_fn(ast::proto_shared, p);
+    } else if eat_word(p, "lambda") {
+        t = parse_ty_fn(ast::proto_box, p);
     } else if eat_word(p, "sendfn") {
-        t = parse_ty_fn(ast::proto_send, p);
+        t = parse_ty_fn(ast::proto_uniq, p);
     } else if eat_word(p, "obj") {
         t = ast::ty_obj(parse_ty_methods(p, false));
     } else if p.peek() == token::MOD_SEP || is_ident(p.peek()) {
@@ -821,10 +821,10 @@ fn parse_bottom_expr(p: parser) -> pexpr {
         ret pexpr(parse_fn_expr(p, proto));
     } else if eat_word(p, "block") {
         ret pexpr(parse_fn_expr(p, ast::proto_block));
-    } else if eat_word(p, "fn@") {
-        ret pexpr(parse_fn_expr(p, ast::proto_shared));
+    } else if eat_word(p, "lambda") {
+        ret pexpr(parse_fn_expr(p, ast::proto_box));
     } else if eat_word(p, "sendfn") {
-        ret pexpr(parse_fn_expr(p, ast::proto_send));
+        ret pexpr(parse_fn_expr(p, ast::proto_uniq));
     } else if eat_word(p, "unchecked") {
         ret pexpr(parse_block_expr(p, lo, ast::unchecked_blk));
     } else if eat_word(p, "unsafe") {
@@ -2113,7 +2113,10 @@ fn parse_item_tag(p: parser, attrs: [ast::attribute]) -> @ast::item {
 fn parse_fn_ty_proto(p: parser) -> ast::proto {
     if p.peek() == token::AT {
         p.bump();
-        ast::proto_shared
+        ast::proto_box
+    } else if p.peek() == token::TILDE {
+        p.bump();
+        ast::proto_uniq
     } else {
         ast::proto_bare
     }
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index fc0a67dee23..b35ccc456d5 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -1684,8 +1684,8 @@ fn proto_to_str(p: ast::proto) -> str {
     ret alt p {
           ast::proto_bare. { "fn" }
           ast::proto_block. { "block" }
-          ast::proto_send. { "sendfn" }
-          ast::proto_shared. { "fn@" }
+          ast::proto_uniq. { "fn~" }
+          ast::proto_box. { "fn@" }
         };
 }