From 04a2887f8791bb080b4e76a55949a7c1954dbb97 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 18 Jan 2012 22:37:22 -0800 Subject: Remove '.' after nullary tags in patterns Does what it says on the tin. The next commit will remove support for this syntax. --- src/comp/metadata/creader.rs | 10 ++--- src/comp/metadata/decoder.rs | 6 +-- src/comp/metadata/encoder.rs | 14 +++---- src/comp/metadata/tydecode.rs | 2 +- src/comp/metadata/tyencode.rs | 90 +++++++++++++++++++++---------------------- 5 files changed, 61 insertions(+), 61 deletions(-) (limited to 'src/comp/metadata') diff --git a/src/comp/metadata/creader.rs b/src/comp/metadata/creader.rs index fd87b54a0a6..93a6f761306 100644 --- a/src/comp/metadata/creader.rs +++ b/src/comp/metadata/creader.rs @@ -68,7 +68,7 @@ fn visit_item(e: env, i: @ast::item) { } nn } - none. { i.ident } + none { i.ident } }; let already_added = false; if vec::len(attr::find_attrs_by_name(i.attrs, "nolink")) == 0u { @@ -84,7 +84,7 @@ fn visit_item(e: env, i: @ast::item) { some(linkarg) { cstore::add_used_link_args(cstore, linkarg); } - none. {/* fallthrough */ } + none {/* fallthrough */ } } } } @@ -96,7 +96,7 @@ fn visit_item(e: env, i: @ast::item) { fn list_file_metadata(sess: session::session, path: str, out: io::writer) { alt get_metadata_section(sess, path) { option::some(bytes) { decoder::list_crate_metadata(bytes, out); } - option::none. { + option::none { out.write_str("Could not find metadata in " + path + ".\n"); } } @@ -154,7 +154,7 @@ fn find_library_crate(sess: session::session, ident: ast::ident, _ { ident } } } - none. { ident } + none { ident } } }; @@ -239,7 +239,7 @@ fn load_library_crate(sess: session::session, span: span, ident: ast::ident, alt find_library_crate(sess, ident, metas) { some(t) { ret t; } - none. { + none { sess.span_fatal(span, #fmt["can't find crate for '%s'", ident]); } } diff --git a/src/comp/metadata/decoder.rs b/src/comp/metadata/decoder.rs index ace34b79a0c..e3790e4b09b 100644 --- a/src/comp/metadata/decoder.rs +++ b/src/comp/metadata/decoder.rs @@ -286,7 +286,7 @@ fn get_impls_for_mod(cdata: cmd, m_id: ast::node_id, ebml::tagged_docs(mod_item, tag_mod_impl) {|doc| let did = translate_def_id(cdata, parse_def_id(ebml::doc_data(doc))); let item = lookup_item(did.node, data), nm = item_name(item); - if alt name { some(n) { n == nm } none. { true } } { + if alt name { some(n) { n == nm } none { true } } { let base_tps = item_ty_param_count(doc); result += [@{did: did, ident: nm, methods: item_impl_methods(cdata, item, base_tps)}]; @@ -393,7 +393,7 @@ fn get_attributes(md: ebml::doc) -> [ast::attribute] { span: ast_util::dummy_sp()}]; }; } - option::none. { } + option::none { } } ret attrs; } @@ -489,7 +489,7 @@ fn translate_def_id(cdata: cmd, did: ast::def_id) -> ast::def_id { alt cdata.cnum_map.find(did.crate) { option::some(n) { ret {crate: n, node: did.node}; } - option::none. { fail "didn't find a crate in the cnum_map"; } + option::none { fail "didn't find a crate in the cnum_map"; } } } diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index 1a0a6cfef90..279f761dfb2 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -296,9 +296,9 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item, encode_def_id(ebml_w, local_def(item.id)); encode_family(ebml_w, alt decl.purity { - unsafe_fn. { 'u' } - pure_fn. { 'p' } - impure_fn. { 'f' } + unsafe_fn { 'u' } + pure_fn { 'p' } + impure_fn { 'f' } } as u8); encode_type_param_bounds(ebml_w, ecx, tps); encode_type(ecx, ebml_w, node_id_to_monotype(tcx, item.id)); @@ -420,7 +420,7 @@ fn encode_info_for_native_item(ecx: @encode_ctxt, ebml_w: ebml::writer, nitem: @native_item) { ebml::start_tag(ebml_w, tag_items_data_item); alt nitem.node { - native_item_ty. { + native_item_ty { encode_def_id(ebml_w, local_def(nitem.id)); encode_family(ebml_w, 'T' as u8); encode_type(ecx, ebml_w, @@ -429,9 +429,9 @@ fn encode_info_for_native_item(ecx: @encode_ctxt, ebml_w: ebml::writer, native_item_fn(fn_decl, tps) { let letter = alt fn_decl.purity { - unsafe_fn. { 'U' } - pure_fn. { 'P' } // this is currently impossible, but hey. - impure_fn. { 'F' } + unsafe_fn { 'U' } + pure_fn { 'P' } // this is currently impossible, but hey. + impure_fn { 'F' } } as u8; encode_def_id(ebml_w, local_def(nitem.id)); encode_family(ebml_w, letter); diff --git a/src/comp/metadata/tydecode.rs b/src/comp/metadata/tydecode.rs index 812a33b8b7a..266b319fe29 100644 --- a/src/comp/metadata/tydecode.rs +++ b/src/comp/metadata/tydecode.rs @@ -277,7 +277,7 @@ fn parse_ty(st: @pstate, conv: conv_did) -> ty::t { assert (next(st) as char == '#'); alt st.tcx.rcache.find({cnum: st.crate, pos: pos, len: len}) { some(tt) { ret tt; } - none. { + none { let ps = @{pos: pos with *st}; let tt = parse_ty(ps, conv); st.tcx.rcache.insert({cnum: st.crate, pos: pos, len: len}, tt); diff --git a/src/comp/metadata/tyencode.rs b/src/comp/metadata/tyencode.rs index 13a941da031..d4c562b67f9 100644 --- a/src/comp/metadata/tyencode.rs +++ b/src/comp/metadata/tyencode.rs @@ -29,17 +29,17 @@ tag abbrev_ctxt { ac_no_abbrevs; ac_use_abbrevs(hashmap); } fn cx_uses_abbrevs(cx: @ctxt) -> bool { alt cx.abbrevs { - ac_no_abbrevs. { ret false; } + ac_no_abbrevs { ret false; } ac_use_abbrevs(_) { ret true; } } } fn enc_ty(w: io::writer, cx: @ctxt, t: ty::t) { alt cx.abbrevs { - ac_no_abbrevs. { + ac_no_abbrevs { let result_str = alt cx.tcx.short_names_cache.find(t) { some(s) { *s } - none. { + none { let buf = io::mk_mem_buffer(); enc_sty(io::mem_buffer_writer(buf), cx, ty::struct_raw(cx.tcx, t)); @@ -52,7 +52,7 @@ fn enc_ty(w: io::writer, cx: @ctxt, t: ty::t) { ac_use_abbrevs(abbrevs) { alt abbrevs.find(t) { some(a) { w.write_str(*a.s); ret; } - none. { + none { let pos = w.tell(); enc_sty(w, cx, ty::struct_raw(cx.tcx, t)); let end = w.tell(); @@ -79,44 +79,44 @@ fn enc_ty(w: io::writer, cx: @ctxt, t: ty::t) { } fn enc_mt(w: io::writer, cx: @ctxt, mt: ty::mt) { alt mt.mut { - imm. { } - mut. { w.write_char('m'); } - maybe_mut. { w.write_char('?'); } + imm { } + mut { w.write_char('m'); } + maybe_mut { w.write_char('?'); } } enc_ty(w, cx, mt.ty); } fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) { alt st { - ty::ty_nil. { w.write_char('n'); } - ty::ty_bot. { w.write_char('z'); } - ty::ty_bool. { w.write_char('b'); } + ty::ty_nil { w.write_char('n'); } + ty::ty_bot { w.write_char('z'); } + ty::ty_bool { w.write_char('b'); } ty::ty_int(t) { alt t { - ty_i. { w.write_char('i'); } - ty_char. { w.write_char('c'); } - ty_i8. { w.write_str("MB"); } - ty_i16. { w.write_str("MW"); } - ty_i32. { w.write_str("ML"); } - ty_i64. { w.write_str("MD"); } + ty_i { w.write_char('i'); } + ty_char { w.write_char('c'); } + ty_i8 { w.write_str("MB"); } + ty_i16 { w.write_str("MW"); } + ty_i32 { w.write_str("ML"); } + ty_i64 { w.write_str("MD"); } } } ty::ty_uint(t) { alt t { - ty_u. { w.write_char('u'); } - ty_u8. { w.write_str("Mb"); } - ty_u16. { w.write_str("Mw"); } - ty_u32. { w.write_str("Ml"); } - ty_u64. { w.write_str("Md"); } + ty_u { w.write_char('u'); } + ty_u8 { w.write_str("Mb"); } + ty_u16 { w.write_str("Mw"); } + ty_u32 { w.write_str("Ml"); } + ty_u64 { w.write_str("Md"); } } } ty::ty_float(t) { alt t { - ty_f. { w.write_char('l'); } - ty_f32. { w.write_str("Mf"); } - ty_f64. { w.write_str("MF"); } + ty_f { w.write_char('l'); } + ty_f32 { w.write_str("Mf"); } + ty_f64 { w.write_str("MF"); } } } - ty::ty_str. { w.write_char('S'); } + ty::ty_str { w.write_char('S'); } ty::ty_tag(def, tys) { w.write_str("t["); w.write_str(cx.ds(def)); @@ -178,11 +178,11 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) { w.write_char('|'); w.write_str(uint::str(id)); } - ty::ty_type. { w.write_char('Y'); } - ty::ty_send_type. { w.write_char('y'); } - ty::ty_opaque_closure_ptr(ty::ck_block.) { w.write_str("C&"); } - ty::ty_opaque_closure_ptr(ty::ck_box.) { w.write_str("C@"); } - ty::ty_opaque_closure_ptr(ty::ck_uniq.) { w.write_str("C~"); } + ty::ty_type { w.write_char('Y'); } + ty::ty_send_type { w.write_char('y'); } + ty::ty_opaque_closure_ptr(ty::ck_block) { w.write_str("C&"); } + ty::ty_opaque_closure_ptr(ty::ck_box) { w.write_str("C@"); } + ty::ty_opaque_closure_ptr(ty::ck_uniq) { w.write_str("C~"); } ty::ty_constr(ty, cs) { w.write_str("A["); enc_ty(w, cx, ty); @@ -201,11 +201,11 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) { } fn enc_proto(w: io::writer, proto: proto) { alt proto { - proto_uniq. { w.write_str("f~"); } - proto_box. { w.write_str("f@"); } - proto_block. { w.write_str("f&"); } - proto_any. { w.write_str("f*"); } - proto_bare. { w.write_str("fn"); } + proto_uniq { w.write_str("f~"); } + proto_box { w.write_str("f@"); } + proto_block { w.write_str("f&"); } + proto_any { w.write_str("f*"); } + proto_bare { w.write_str("fn"); } } } @@ -213,11 +213,11 @@ fn enc_ty_fn(w: io::writer, cx: @ctxt, ft: ty::fn_ty) { w.write_char('['); for arg: ty::arg in ft.inputs { alt arg.mode { - by_mut_ref. { w.write_char('&'); } - by_move. { w.write_char('-'); } - by_copy. { w.write_char('+'); } - by_ref. { w.write_char('='); } - by_val. { w.write_char('#'); } + by_mut_ref { w.write_char('&'); } + by_move { w.write_char('-'); } + by_copy { w.write_char('+'); } + by_ref { w.write_char('='); } + by_val { w.write_char('#'); } } enc_ty(w, cx, arg.ty); } @@ -231,7 +231,7 @@ fn enc_ty_fn(w: io::writer, cx: @ctxt, ft: ty::fn_ty) { enc_constr(w, cx, c); } alt ft.ret_style { - noreturn. { w.write_char('!'); } + noreturn { w.write_char('!'); } _ { enc_ty(w, cx, ft.output); } } } @@ -246,7 +246,7 @@ fn enc_constr(w: io::writer, cx: @ctxt, c: @ty::constr) { for a: @constr_arg in c.node.args { if semi { w.write_char(';'); } else { semi = true; } alt a.node { - carg_base. { w.write_char('*'); } + carg_base { w.write_char('*'); } carg_ident(i) { w.write_uint(i); } carg_lit(l) { w.write_str(lit_to_str(l)); } } @@ -263,7 +263,7 @@ fn enc_ty_constr(w: io::writer, cx: @ctxt, c: @ty::type_constr) { for a: @ty::ty_constr_arg in c.node.args { if semi { w.write_char(';'); } else { semi = true; } alt a.node { - carg_base. { w.write_char('*'); } + carg_base { w.write_char('*'); } carg_ident(p) { w.write_str(path_to_str(p)); } carg_lit(l) { w.write_str(lit_to_str(l)); } } @@ -274,8 +274,8 @@ fn enc_ty_constr(w: io::writer, cx: @ctxt, c: @ty::type_constr) { fn enc_bounds(w: io::writer, cx: @ctxt, bs: @[ty::param_bound]) { for bound in *bs { alt bound { - ty::bound_send. { w.write_char('S'); } - ty::bound_copy. { w.write_char('C'); } + ty::bound_send { w.write_char('S'); } + ty::bound_copy { w.write_char('C'); } ty::bound_iface(tp) { w.write_char('I'); enc_ty(w, cx, tp); -- cgit 1.4.1-3-g733a5