diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2012-12-17 19:31:04 -0800 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2012-12-17 20:00:36 -0800 |
| commit | 8650c6f683cf43e9ced27e81945c20234d2bb61c (patch) | |
| tree | bd2e18afb29e2d998bf2a4e55f47c43867026901 /src/libsyntax | |
| parent | ec9305802ba1bde2d0de34278395379de69f3468 (diff) | |
| download | rust-8650c6f683cf43e9ced27e81945c20234d2bb61c.tar.gz rust-8650c6f683cf43e9ced27e81945c20234d2bb61c.zip | |
Switch from serialization to std::serialize. (snapshot)
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 345 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 15 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 14 |
5 files changed, 187 insertions, 193 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 351b2995471..da49340e24a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -10,15 +10,12 @@ // The Rust abstract syntax tree. -use std::serialization::{Serializable, - Deserializable, - Serializer, - Deserializer}; +use std::serialize::{Encodable, Decodable, Encoder, Decoder}; use codemap::{span, FileName}; use parse::token; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type spanned<T> = {node: T, span: span}; @@ -33,12 +30,12 @@ macro_rules! interner_key ( // implemented. struct ident { repr: uint } -impl<S: Serializer> ident: Serializable<S> { - fn serialize(&self, s: &S) { +impl<S: Encoder> ident: Encodable<S> { + fn encode(&self, s: &S) { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) } { - None => fail ~"serialization: TLS interner not set up", + None => fail ~"encode: TLS interner not set up", Some(intr) => intr }; @@ -46,12 +43,12 @@ impl<S: Serializer> ident: Serializable<S> { } } -impl<D: Deserializer> ident: Deserializable<D> { - static fn deserialize(d: &D) -> ident { +impl<D: Decoder> ident: Decodable<D> { + static fn decode(d: &D) -> ident { let intr = match unsafe { task::local_data::local_data_get(interner_key!()) } { - None => fail ~"deserialization: TLS interner not set up", + None => fail ~"decode: TLS interner not set up", Some(intr) => intr }; @@ -73,8 +70,8 @@ impl ident: to_bytes::IterBytes { // Functions may or may not have names. type fn_ident = Option<ident>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type path = {span: span, global: bool, idents: ~[ident], @@ -85,8 +82,8 @@ type crate_num = int; type node_id = int; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type def_id = {crate: crate_num, node: node_id}; impl def_id : cmp::Eq { @@ -99,20 +96,20 @@ impl def_id : cmp::Eq { const local_crate: crate_num = 0; const crate_node_id: node_id = 0; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] // The AST represents all type param bounds as types. // typeck::collect::compute_bounds matches these against // the "special" built-in traits (see middle::lang_items) and // detects Copy, Send, Owned, and Const. enum ty_param_bound = @Ty; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type ty_param = {ident: ident, id: node_id, bounds: @~[ty_param_bound]}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum def { def_fn(def_id, purity), def_static_method(/* method */ def_id, @@ -284,8 +281,8 @@ type crate_ = type meta_item = spanned<meta_item_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum meta_item_ { meta_word(~str), meta_list(~str, ~[@meta_item]), @@ -294,24 +291,24 @@ enum meta_item_ { type blk = spanned<blk_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type blk_ = {view_items: ~[@view_item], stmts: ~[@stmt], expr: Option<@expr>, id: node_id, rules: blk_check_mode}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type pat = {id: node_id, node: pat_, span: span}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type field_pat = {ident: ident, pat: @pat}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum binding_mode { bind_by_value, bind_by_move, @@ -367,8 +364,8 @@ impl binding_mode : cmp::Eq { pure fn ne(&self, other: &binding_mode) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum pat_ { pat_wild, // A pat_ident may either be a new bound variable, @@ -392,8 +389,8 @@ enum pat_ { pat_vec(~[@pat], Option<@pat>) } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum mutability { m_mutbl, m_imm, m_const, } impl mutability : to_bytes::IterBytes { @@ -409,8 +406,8 @@ impl mutability : cmp::Eq { pure fn ne(&self, other: &mutability) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] pub enum Proto { ProtoBare, // bare functions (deprecated) ProtoUniq, // ~fn @@ -431,8 +428,8 @@ impl Proto : to_bytes::IterBytes { } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum vstore { // FIXME (#3469): Change uint to @expr (actually only constant exprs) vstore_fixed(Option<uint>), // [1,2,3,4] @@ -441,8 +438,8 @@ enum vstore { vstore_slice(@region) // &[1,2,3,4](foo)? } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum expr_vstore { // FIXME (#3469): Change uint to @expr (actually only constant exprs) expr_vstore_fixed(Option<uint>), // [1,2,3,4] @@ -460,8 +457,8 @@ pure fn is_blockish(p: ast::Proto) -> bool { } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum binop { add, subtract, @@ -490,8 +487,8 @@ impl binop : cmp::Eq { pure fn ne(&self, other: &binop) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum unop { box(mutability), uniq(mutability), @@ -542,8 +539,8 @@ impl unop : cmp::Eq { // Generally, after typeck you can get the inferred value // using ty::resolved_T(...). -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum inferable<T> { expl(T), infer(node_id) @@ -582,8 +579,8 @@ impl<T:cmp::Eq> inferable<T> : cmp::Eq { } // "resolved" mode: the real modes. -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum rmode { by_ref, by_val, by_move, by_copy } impl rmode : to_bytes::IterBytes { @@ -605,8 +602,8 @@ type mode = inferable<rmode>; type stmt = spanned<stmt_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum stmt_ { stmt_decl(@decl, node_id), @@ -622,8 +619,8 @@ enum stmt_ { // FIXME (pending discussion of #1697, #2178...): local should really be // a refinement on pat. -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type local_ = {is_mutbl: bool, ty: @Ty, pat: @pat, init: Option<@expr>, id: node_id}; @@ -631,22 +628,22 @@ type local = spanned<local_>; type decl = spanned<decl_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum decl_ { decl_local(~[@local]), decl_item(@item), } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type arm = {pats: ~[@pat], guard: Option<@expr>, body: blk}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type field_ = {mutbl: mutability, ident: ident, expr: @expr}; type field = spanned<field_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum blk_check_mode { default_blk, unsafe_blk, } impl blk_check_mode : cmp::Eq { @@ -661,18 +658,18 @@ impl blk_check_mode : cmp::Eq { pure fn ne(&self, other: &blk_check_mode) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type expr = {id: node_id, callee_id: node_id, node: expr_, span: span}; // Extra node ID is only used for index, assign_op, unary, binary, method call -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum log_level { error, debug, log_other } // 0 = error, 1 = debug, 2 = log_other -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum expr_ { expr_vstore(@expr, expr_vstore), expr_vec(~[@expr], mutability), @@ -731,8 +728,8 @@ enum expr_ { expr_paren(@expr) } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type capture_item_ = { id: int, is_move: bool, @@ -760,8 +757,8 @@ type capture_clause = @~[capture_item]; // else knows what to do with them, so you'll probably get a syntax // error. // -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] #[doc="For macro invocations; parsing is delegated to the macro"] enum token_tree { tt_tok(span, token::Token), @@ -825,8 +822,8 @@ enum token_tree { // type matcher = spanned<matcher_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum matcher_ { // match one token match_tok(token::Token), @@ -839,16 +836,16 @@ enum matcher_ { type mac = spanned<mac_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum mac_ { mac_invoc_tt(@path,~[token_tree]), // new macro-invocation } type lit = spanned<lit_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum lit_ { lit_str(@~str), lit_int(i64, int_ty), @@ -892,24 +889,24 @@ impl ast::lit_: cmp::Eq { // NB: If you change this, you'll probably want to change the corresponding // type structure in middle/ty.rs as well. -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type mt = {ty: @Ty, mutbl: mutability}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type ty_field_ = {ident: ident, mt: mt}; type ty_field = spanned<ty_field_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type ty_method = {ident: ident, attrs: ~[attribute], purity: purity, decl: fn_decl, tps: ~[ty_param], self_ty: self_ty, id: node_id, span: span}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] // A trait method is either required (meaning it doesn't have an // implementation, just a signature) or provided (meaning it has a default // implementation). @@ -918,8 +915,8 @@ enum trait_method { provided(@method), } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, } impl int_ty : to_bytes::IterBytes { @@ -948,8 +945,8 @@ impl int_ty : cmp::Eq { pure fn ne(&self, other: &int_ty) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, } impl uint_ty : to_bytes::IterBytes { @@ -976,8 +973,8 @@ impl uint_ty : cmp::Eq { pure fn ne(&self, other: &uint_ty) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum float_ty { ty_f, ty_f32, ty_f64, } impl float_ty : to_bytes::IterBytes { @@ -996,13 +993,13 @@ impl float_ty : cmp::Eq { pure fn ne(&self, other: &float_ty) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type Ty = {id: node_id, node: ty_, span: span}; // Not represented directly in the AST, referred to by name through a ty_path. -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum prim_ty { ty_int(int_ty), ty_uint(uint_ty), @@ -1049,12 +1046,12 @@ impl prim_ty : cmp::Eq { pure fn ne(&self, other: &prim_ty) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type region = {id: node_id, node: region_}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum region_ { re_anon, re_static, @@ -1062,8 +1059,8 @@ enum region_ { re_named(ident) } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum Onceness { Once, Many @@ -1081,8 +1078,8 @@ impl Onceness : cmp::Eq { } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] struct TyFn { proto: Proto, region: Option<@region>, @@ -1092,8 +1089,8 @@ struct TyFn { decl: fn_decl } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum ty_ { ty_nil, ty_bot, /* bottom type */ @@ -1132,19 +1129,19 @@ impl Ty : to_bytes::IterBytes { } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type arg = {mode: mode, ty: @Ty, pat: @pat, id: node_id}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type fn_decl = {inputs: ~[arg], output: @Ty, cf: ret_style}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum purity { pure_fn, // declared with "pure fn" unsafe_fn, // declared with "unsafe fn" @@ -1165,8 +1162,8 @@ impl purity : cmp::Eq { pure fn ne(&self, other: &purity) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum ret_style { noreturn, // functions with return type _|_ that always // raise an error or exit (i.e. never return to the caller) @@ -1191,8 +1188,8 @@ impl ret_style : cmp::Eq { pure fn ne(&self, other: &ret_style) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum self_ty_ { sty_static, // no self: static method sty_by_ref, // old by-reference self: `` @@ -1248,20 +1245,20 @@ impl self_ty_ : cmp::Eq { type self_ty = spanned<self_ty_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type method = {ident: ident, attrs: ~[attribute], tps: ~[ty_param], self_ty: self_ty, purity: purity, decl: fn_decl, body: blk, id: node_id, span: span, self_id: node_id, vis: visibility}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type _mod = {view_items: ~[@view_item], items: ~[@item]}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum foreign_abi { foreign_abi_rust_intrinsic, foreign_abi_cdecl, @@ -1269,8 +1266,8 @@ enum foreign_abi { } // Foreign mods can be named or anonymous -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum foreign_mod_sort { named, anonymous } impl foreign_mod_sort : cmp::Eq { @@ -1294,49 +1291,49 @@ impl foreign_abi : cmp::Eq { pure fn ne(&self, other: &foreign_abi) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type foreign_mod = {sort: foreign_mod_sort, abi: ident, view_items: ~[@view_item], items: ~[@foreign_item]}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type variant_arg = {ty: @Ty, id: node_id}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum variant_kind { tuple_variant_kind(~[variant_arg]), struct_variant_kind(@struct_def), enum_variant_kind(enum_def) } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type enum_def_ = { variants: ~[variant], common: Option<@struct_def> }; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum enum_def = enum_def_; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type variant_ = {name: ident, attrs: ~[attribute], kind: variant_kind, id: node_id, disr_expr: Option<@expr>, vis: visibility}; type variant = spanned<variant_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type path_list_ident_ = {name: ident, id: node_id}; type path_list_ident = spanned<path_list_ident_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum namespace { module_ns, type_value_ns } impl namespace : cmp::Eq { @@ -1348,8 +1345,8 @@ impl namespace : cmp::Eq { type view_path = spanned<view_path_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum view_path_ { // quux = foo::bar::baz @@ -1366,13 +1363,13 @@ enum view_path_ { view_path_list(@path, ~[path_list_ident], node_id) } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type view_item = {node: view_item_, attrs: ~[attribute], vis: visibility, span: span}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum view_item_ { view_item_use(ident, ~[@meta_item], node_id), view_item_import(~[@view_path]), @@ -1385,8 +1382,8 @@ type attribute = spanned<attribute_>; // Distinguishes between attributes that decorate items and attributes that // are contained as statements within items. These two cases need to be // distinguished for pretty-printing. -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum attr_style { attr_outer, attr_inner, } impl attr_style : cmp::Eq { @@ -1397,8 +1394,8 @@ impl attr_style : cmp::Eq { } // doc-comments are promoted to attributes that have is_sugared_doc = true -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type attribute_ = {style: attr_style, value: meta_item, is_sugared_doc: bool}; /* @@ -1408,12 +1405,12 @@ type attribute_ = {style: attr_style, value: meta_item, is_sugared_doc: bool}; If this impl is an item_impl, the impl_id is redundant (it could be the same as the impl's node id). */ -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type trait_ref = {path: @path, ref_id: node_id}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum visibility { public, private, inherited } impl visibility : cmp::Eq { @@ -1430,8 +1427,8 @@ impl visibility : cmp::Eq { pure fn ne(&self, other: &visibility) -> bool { !(*self).eq(other) } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type struct_field_ = { kind: struct_field_kind, id: node_id, @@ -1440,8 +1437,8 @@ type struct_field_ = { type struct_field = spanned<struct_field_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum struct_field_kind { named_field(ident, struct_mutability, visibility), unnamed_field // element of a tuple-like struct @@ -1474,8 +1471,8 @@ impl struct_field_kind : cmp::Eq { } } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type struct_def = { fields: ~[@struct_field], /* fields */ /* (not including ctor or dtor) */ @@ -1490,14 +1487,14 @@ type struct_def = { FIXME (#3300): Should allow items to be anonymous. Right now we just use dummy names for anon items. */ -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type item = {ident: ident, attrs: ~[attribute], id: node_id, node: item_, vis: visibility, span: span}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum item_ { item_const(@Ty, @expr), item_fn(fn_decl, purity, ~[ty_param], blk), @@ -1514,8 +1511,8 @@ enum item_ { item_mac(mac), } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum struct_mutability { struct_mutable, struct_immutable } impl struct_mutability : to_bytes::IterBytes { @@ -1540,15 +1537,15 @@ impl struct_mutability : cmp::Eq { type struct_dtor = spanned<struct_dtor_>; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type struct_dtor_ = {id: node_id, attrs: ~[attribute], self_id: node_id, body: blk}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type foreign_item = {ident: ident, attrs: ~[attribute], @@ -1557,8 +1554,8 @@ type foreign_item = span: span, vis: visibility}; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum foreign_item_ { foreign_item_fn(fn_decl, purity, ~[ty_param]), foreign_item_const(@Ty) @@ -1567,8 +1564,8 @@ enum foreign_item_ { // The data we save and restore about an inlined item or method. This is not // part of the AST that we parse from a file, but it becomes part of the tree // that we trans. -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum inlined_item { ii_item(@item), ii_method(def_id /* impl id */, @method), diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 294a66166fa..521114bf297 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -417,8 +417,8 @@ fn dtor_dec() -> fn_decl { // ______________________________________________________________________ // Enumerating the IDs which appear in an AST -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] type id_range = {min: node_id, max: node_id}; fn empty(range: id_range) -> bool { diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 6481785e61a..974455972f1 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -22,10 +22,7 @@ source code snippets, etc. */ use dvec::DVec; -use std::serialization::{Serializable, - Deserializable, - Serializer, - Deserializer}; +use std::serialize::{Encodable, Decodable, Encoder, Decoder}; trait Pos { static pure fn from_uint(n: uint) -> self; @@ -131,13 +128,13 @@ impl span : cmp::Eq { pure fn ne(&self, other: &span) -> bool { !(*self).eq(other) } } -impl<S: Serializer> span: Serializable<S> { - /* Note #1972 -- spans are serialized but not deserialized */ - fn serialize(&self, _s: &S) { } +impl<S: Encoder> span: Encodable<S> { + /* Note #1972 -- spans are encoded but not decoded */ + fn encode(&self, _s: &S) { } } -impl<D: Deserializer> span: Deserializable<D> { - static fn deserialize(_d: &D) -> span { +impl<D: Decoder> span: Decodable<D> { + static fn decode(_d: &D) -> span { ast_util::dummy_sp() } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index a35f351451b..a65f5f33512 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -77,7 +77,7 @@ fn expand_expr(exts: HashMap<~str, syntax_extension>, cx: ext_ctxt, } // This is a secondary mechanism for invoking syntax extensions on items: -// "decorator" attributes, such as #[auto_serialize]. These are invoked by an +// "decorator" attributes, such as #[auto_encode]. These are invoked by an // attribute prefixing an item, and are interpreted by feeding the item // through the named attribute _as a syntax extension_ and splicing in the // resulting item vec into place in favour of the decorator. Note that diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 7e7c61d2bf2..04e6e187dbb 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -12,8 +12,8 @@ use util::interner; use util::interner::Interner; use std::map::HashMap; -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum binop { PLUS, MINUS, @@ -27,8 +27,8 @@ enum binop { SHR, } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] enum Token { /* Expression-operator symbols. */ EQ, @@ -85,8 +85,8 @@ enum Token { EOF, } -#[auto_serialize] -#[auto_deserialize] +#[auto_encode] +#[auto_decode] /// For interpolation during macro expansion. enum nonterminal { nt_item(@ast::item), @@ -351,7 +351,7 @@ impl ident_interner { } /* Key for thread-local data for sneaking interner information to the - * serializer/deserializer. It sounds like a hack because it is one. + * encoder/decoder. It sounds like a hack because it is one. * Bonus ultra-hack: functions as keys don't work across crates, * so we have to use a unique number. See taskgroup_key! in task.rs * for another case of this. */ |
