diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-01-18 18:10:51 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-01-19 07:11:50 -0800 |
| commit | 882bea5b6d016006ab110d3a9526ffca0a479e27 (patch) | |
| tree | 128947943bb451a54c1e5425d78fd423ed5cfafd /src/comp/syntax/parse/parser.rs | |
| parent | 1f0b3d2247ce6ff381f572450dbe733291ffe01a (diff) | |
| download | rust-882bea5b6d016006ab110d3a9526ffca0a479e27.tar.gz rust-882bea5b6d016006ab110d3a9526ffca0a479e27.zip | |
Rename fn*() to fn() as originally planned.
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index ee947772ab2..a5980465048 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -146,8 +146,8 @@ fn bad_expr_word_table() -> hashmap<str, ()> { for word in ["mod", "if", "else", "while", "do", "alt", "for", "break", "cont", "ret", "be", "fail", "type", "resource", "check", "assert", "claim", "native", "fn", "pure", - "unsafe", "import", "export", "let", "const", - "log", "copy", "impl", "iface", "enum"] { + "unsafe", "block", "import", "export", "let", "const", + "log", "copy", "sendfn", "impl", "iface", "enum"] { words.insert(word, ()); } words @@ -493,6 +493,9 @@ fn parse_ty(p: parser, colons_before_params: bool) -> @ast::ty { _ { /* fallthrough */ } } t = parse_ty_fn(proto, p); + } else if eat_word(p, "block") { + //p.warn("block is deprecated, use fn& or fn"); + t = parse_ty_fn(ast::proto_block, p); } else if eat_word(p, "native") { expect_word(p, "fn"); t = parse_ty_fn(ast::proto_bare, p); @@ -799,6 +802,9 @@ fn parse_bottom_expr(p: parser) -> pexpr { _ { /* fallthrough */ } } ret pexpr(parse_fn_expr(p, proto)); + } else if eat_word(p, "block") { + p.warn("block is deprecated, use fn& or fn"); + ret pexpr(parse_fn_expr(p, ast::proto_block)); } else if eat_word(p, "unchecked") { ret pexpr(parse_block_expr(p, lo, ast::unchecked_blk)); } else if eat_word(p, "unsafe") { @@ -2109,12 +2115,8 @@ fn parse_fn_ty_proto(p: parser) -> ast::proto { p.bump(); ast::proto_block } - token::BINOP(token::STAR) { - p.bump(); // temporary: fn* for any closure - ast::proto_any - } _ { - ast::proto_bare + ast::proto_any } } } |
