diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-01-23 14:59:00 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-01-23 19:06:33 -0800 |
| commit | 5e13d19cc07a1e8fbf478d21cabbd7b9f80e3b54 (patch) | |
| tree | c1fc2dd89c651efa1daa4e7d63c5b82b2a5f4bd2 /src/comp/syntax | |
| parent | 04351a84ca342f4580e40b9c195b5403b864090b (diff) | |
s/block()/fn()/g
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/ext/simplext.rs | 4 | ||||
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 22 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 6 |
3 files changed, 13 insertions, 19 deletions
diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs index dcaf16c973e..5477c495883 100644 --- a/src/comp/syntax/ext/simplext.rs +++ b/src/comp/syntax/ext/simplext.rs @@ -241,7 +241,7 @@ fn follow_for_trans(cx: ext_ctxt, mmaybe: option::t<arb_depth<matchable>>, } /* helper for transcribe_exprs: what vars from `b` occur in `e`? */ -fn free_vars(b: bindings, e: @expr, it: block(ident)) { +fn free_vars(b: bindings, e: @expr, it: fn(ident)) { let idents: hashmap<ident, ()> = new_str_hash::<()>(); fn mark_ident(&&i: ident, _fld: ast_fold, b: bindings, idents: hashmap<ident, ()>) -> ident { @@ -536,7 +536,7 @@ fn block_to_ident(blk: blk_) -> option::t<ident> { fn p_t_s_r_mac(cx: ext_ctxt, mac: ast::mac, s: selector, b: binders) { fn select_pt_1(cx: ext_ctxt, m: matchable, - fn_m: block(ast::mac) -> match_result) -> match_result { + fn_m: fn(ast::mac) -> match_result) -> match_result { ret alt m { match_expr(e) { alt e.node { expr_mac(mac) { fn_m(mac) } _ { none } } diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index cb7e1144334..5a4925486d9 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -149,7 +149,7 @@ 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", "block", "import", "export", "let", "const", + "unsafe", "import", "export", "let", "const", "log", "copy", "sendfn", "impl", "iface", "enum"] { words.insert(word, ()); } @@ -366,7 +366,7 @@ fn parse_constr_in_type(p: parser) -> @ast::ty_constr { } -fn parse_constrs<T: copy>(pser: block(parser) -> @ast::constr_general<T>, +fn parse_constrs<T: copy>(pser: fn(parser) -> @ast::constr_general<T>, p: parser) -> [@ast::constr_general<T>] { let constrs: [@ast::constr_general<T>] = []; @@ -504,9 +504,6 @@ 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); @@ -545,7 +542,7 @@ fn parse_fn_block_arg(p: parser) -> ast::arg { } fn parse_seq_to_before_gt<T: copy>(sep: option::t<token::token>, - f: block(parser) -> T, + f: fn(parser) -> T, p: parser) -> [T] { let first = true; let v = []; @@ -562,7 +559,7 @@ fn parse_seq_to_before_gt<T: copy>(sep: option::t<token::token>, } fn parse_seq_to_gt<T: copy>(sep: option::t<token::token>, - f: block(parser) -> T, p: parser) -> [T] { + f: fn(parser) -> T, p: parser) -> [T] { let v = parse_seq_to_before_gt(sep, f, p); expect_gt(p); @@ -570,7 +567,7 @@ fn parse_seq_to_gt<T: copy>(sep: option::t<token::token>, } fn parse_seq_lt_gt<T: copy>(sep: option::t<token::token>, - f: block(parser) -> T, + f: fn(parser) -> T, p: parser) -> spanned<[T]> { let lo = p.span.lo; expect(p, token::LT); @@ -581,7 +578,7 @@ fn parse_seq_lt_gt<T: copy>(sep: option::t<token::token>, } fn parse_seq_to_end<T: copy>(ket: token::token, sep: seq_sep, - f: block(parser) -> T, p: parser) -> [T] { + f: fn(parser) -> T, p: parser) -> [T] { let val = parse_seq_to_before_end(ket, sep, f, p); p.bump(); ret val; @@ -604,7 +601,7 @@ fn seq_sep_none() -> seq_sep { fn parse_seq_to_before_end<T: copy>(ket: token::token, sep: seq_sep, - f: block(parser) -> T, p: parser) -> [T] { + f: fn(parser) -> T, p: parser) -> [T] { let first: bool = true; let v: [T] = []; while p.token != ket { @@ -620,7 +617,7 @@ fn parse_seq_to_before_end<T: copy>(ket: token::token, fn parse_seq<T: copy>(bra: token::token, ket: token::token, - sep: seq_sep, f: block(parser) -> T, + sep: seq_sep, f: fn(parser) -> T, p: parser) -> spanned<[T]> { let lo = p.span.lo; expect(p, bra); @@ -813,9 +810,6 @@ 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") { diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 2ebcaa055a7..4327ccf9ac0 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -210,7 +210,7 @@ fn synth_comment(s: ps, text: str) { word(s.s, "*/"); } -fn commasep<IN>(s: ps, b: breaks, elts: [IN], op: block(ps, IN)) { +fn commasep<IN>(s: ps, b: breaks, elts: [IN], op: fn(ps, IN)) { box(s, 0u, b); let first = true; for elt: IN in elts { @@ -221,8 +221,8 @@ fn commasep<IN>(s: ps, b: breaks, elts: [IN], op: block(ps, IN)) { } -fn commasep_cmnt<IN>(s: ps, b: breaks, elts: [IN], op: block(ps, IN), - get_span: block(IN) -> codemap::span) { +fn commasep_cmnt<IN>(s: ps, b: breaks, elts: [IN], op: fn(ps, IN), + get_span: fn(IN) -> codemap::span) { box(s, 0u, b); let len = vec::len::<IN>(elts); let i = 0u; |
