about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-01-09 16:12:37 -0800
committerGraydon Hoare <graydon@mozilla.com>2012-01-09 16:12:48 -0800
commit8387896ddaa5fbe2ba39b9ad06fd02e1bfcb76e7 (patch)
treed326dd79d45136f7cd2960491e89607d671172e5 /src/comp/syntax
parentf6ecbe88ca67769ccb9def337ada9ae25235e00e (diff)
downloadrust-8387896ddaa5fbe2ba39b9ad06fd02e1bfcb76e7.tar.gz
rust-8387896ddaa5fbe2ba39b9ad06fd02e1bfcb76e7.zip
Remove proto_sugar and 'lambda' as keyword, commit to fn@.
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/ast.rs7
-rw-r--r--src/comp/syntax/parse/parser.rs12
-rw-r--r--src/comp/syntax/print/pprust.rs3
-rw-r--r--src/comp/syntax/visit.rs2
4 files changed, 9 insertions, 15 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index c5e9a13616f..1acbabd65f9 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -110,15 +110,10 @@ tag pat_ {
 
 tag mutability { mut; imm; maybe_mut; }
 
-tag proto_sugar {
-    sugar_normal;
-    sugar_sexy;
-}
-
 tag proto {
     proto_bare;
     proto_send;
-    proto_shared(proto_sugar);
+    proto_shared;
     proto_block;
 }
 
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 2b45115f5b9..2eeb5cbf136 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -168,7 +168,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
     let words = new_str_hash();
     for word in ["mod", "if", "else", "while", "do", "alt", "for", "break",
                  "cont", "ret", "be", "fail", "type", "resource", "check",
-                 "assert", "claim", "native", "fn", "lambda", "pure",
+                 "assert", "claim", "native", "fn", "fn@", "pure",
                  "unsafe", "block", "import", "export", "let", "const",
                  "log", "tag", "obj", "copy", "sendfn", "impl", "iface"] {
         words.insert(word, ());
@@ -514,8 +514,8 @@ 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, "lambda") {
-        t = parse_ty_fn(ast::proto_shared(ast::sugar_sexy), p);
+    } else if eat_word(p, "fn@") {
+        t = parse_ty_fn(ast::proto_shared, p);
     } else if eat_word(p, "sendfn") {
         t = parse_ty_fn(ast::proto_send, p);
     } else if eat_word(p, "obj") {
@@ -821,8 +821,8 @@ 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, "lambda") {
-        ret pexpr(parse_fn_expr(p, ast::proto_shared(ast::sugar_sexy)));
+    } else if eat_word(p, "fn@") {
+        ret pexpr(parse_fn_expr(p, ast::proto_shared));
     } else if eat_word(p, "sendfn") {
         ret pexpr(parse_fn_expr(p, ast::proto_send));
     } else if eat_word(p, "unchecked") {
@@ -2117,7 +2117,7 @@ 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::sugar_normal)
+        ast::proto_shared
     } else {
         ast::proto_bare
     }
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index b4a47a8db38..fc0a67dee23 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -1685,8 +1685,7 @@ fn proto_to_str(p: ast::proto) -> str {
           ast::proto_bare. { "fn" }
           ast::proto_block. { "block" }
           ast::proto_send. { "sendfn" }
-          ast::proto_shared(ast::sugar_normal.) { "fn@" }
-          ast::proto_shared(ast::sugar_sexy.) { "lambda" }
+          ast::proto_shared. { "fn@" }
         };
 }
 
diff --git a/src/comp/syntax/visit.rs b/src/comp/syntax/visit.rs
index 7fec9e97e06..1c38095d519 100644
--- a/src/comp/syntax/visit.rs
+++ b/src/comp/syntax/visit.rs
@@ -19,7 +19,7 @@ tag fn_kind {
     fk_item_fn(ident, [ty_param]); //< an item declared with fn()
     fk_method(ident, [ty_param]);
     fk_res(ident, [ty_param]);
-    fk_anon(proto);  //< an anonymous function like lambda(...)
+    fk_anon(proto);  //< an anonymous function like fn@(...)
     fk_fn_block;     //< a block {||...}
 }