diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-11-28 12:33:00 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-11-28 12:33:00 -0800 |
| commit | 8179e268efd86ae5c1bcf21b4f8d4e01eea7c193 (patch) | |
| tree | 7e3fd944a844a195a0ed1bed8717db07a2d8ccc8 /src/libsyntax | |
| parent | be6613e048c889a0aeaff056131c2406259f1fb4 (diff) | |
| download | rust-8179e268efd86ae5c1bcf21b4f8d4e01eea7c193.tar.gz rust-8179e268efd86ae5c1bcf21b4f8d4e01eea7c193.zip | |
Register snapshots
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/alternate_crate.rc | 128 | ||||
| -rw-r--r-- | src/libsyntax/ast.rs | 640 | ||||
| -rw-r--r-- | src/libsyntax/ast_map.rs | 23 | ||||
| -rw-r--r-- | src/libsyntax/attr.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 46 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 15 | ||||
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/parse/obsolete.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 285 | ||||
| -rw-r--r-- | src/libsyntax/print/pp.rs | 15 | ||||
| -rw-r--r-- | src/libsyntax/syntax.rc | 83 |
13 files changed, 27 insertions, 1262 deletions
diff --git a/src/libsyntax/alternate_crate.rc b/src/libsyntax/alternate_crate.rc deleted file mode 100644 index d5a28a716ec..00000000000 --- a/src/libsyntax/alternate_crate.rc +++ /dev/null @@ -1,128 +0,0 @@ -#[link(name = "syntax", - vers = "0.5", - uuid = "9311401b-d6ea-4cd9-a1d9-61f89499c645")]; - - - -#[crate_type = "lib"]; - -#[no_core]; - -#[legacy_modes]; -#[legacy_exports]; - -#[allow(vecs_implicitly_copyable)]; -#[allow(non_camel_case_types)]; -#[allow(deprecated_mode)]; -#[allow(deprecated_pattern)]; - -extern mod core(vers = "0.5"); -extern mod std(vers = "0.5"); - -use core::*; - -#[legacy_exports] -mod attr; -#[legacy_exports] -mod diagnostic; -mod codemap; -#[legacy_exports] -mod ast; -#[legacy_exports] -mod ast_util; -#[legacy_exports] -mod ast_map; -#[legacy_exports] -mod visit; -#[legacy_exports] -mod fold; -#[legacy_exports] -mod util { - #[legacy_exports]; - #[legacy_exports] - #[path = "util/interner.rs"] - mod interner; -} - -#[merge = "parse/mod.rs"] -mod parse; - -mod print { - #[legacy_exports]; - #[legacy_exports] - #[path = "print/pp.rs"] - mod pp; - #[legacy_exports] - #[path = "print/pprust.rs"] - mod pprust; -} - -mod ext { - #[legacy_exports]; - #[legacy_exports] - #[path = "ext/base.rs"] - mod base; - #[legacy_exports] - #[path = "ext/expand.rs"] - mod expand; - #[legacy_exports] - #[path = "ext/qquote.rs"] - mod qquote; - - #[path = "ext/quote.rs"] - mod quote; - #[path = "ext/deriving.rs"] - mod deriving; - - #[legacy_exports] - #[path = "ext/build.rs"] - mod build; - - mod tt { - #[legacy_exports]; - #[legacy_exports] - #[path = "ext/tt/transcribe.rs"] - mod transcribe; - #[legacy_exports] - #[path = "ext/tt/macro_parser.rs"] - mod macro_parser; - #[legacy_exports] - #[path = "ext/tt/macro_rules.rs"] - mod macro_rules; - } - - - #[legacy_exports] - #[path = "ext/simplext.rs"] - mod simplext; - #[legacy_exports] - #[path = "ext/fmt.rs"] - mod fmt; - #[legacy_exports] - #[path = "ext/env.rs"] - mod env; - #[legacy_exports] - #[path = "ext/concat_idents.rs"] - mod concat_idents; - #[legacy_exports] - #[path = "ext/ident_to_str.rs"] - mod ident_to_str; - #[legacy_exports] - #[path = "ext/log_syntax.rs"] - mod log_syntax; - #[legacy_exports] - #[path = "ext/auto_serialize.rs"] - mod auto_serialize; - #[legacy_exports] - #[path = "ext/source_util.rs"] - mod source_util; - - #[legacy_exports] - #[path = "ext/pipes.rs"] - #[merge = "ext/pipes/mod.rs"] - mod pipes; - - #[legacy_exports] - #[path = "ext/trace_macros.rs"] - mod trace_macros; -} diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 21ce366e1c4..1bfb1e77283 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -50,15 +50,7 @@ impl<D: Deserializer> ident: Deserializable<D> { } impl ident: cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &ident) -> bool { self.repr == other.repr } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &ident) -> bool { (*self).repr == other.repr } - #[cfg(stage0)] - pure fn ne(other: &ident) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &ident) -> bool { !(*self).eq(other) } } @@ -88,19 +80,9 @@ type node_id = int; type def_id = {crate: crate_num, node: node_id}; impl def_id : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &def_id) -> bool { - self.crate == (*other).crate && self.node == (*other).node - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &def_id) -> bool { (*self).crate == (*other).crate && (*self).node == (*other).node } - #[cfg(stage0)] - pure fn ne(other: &def_id) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &def_id) -> bool { !(*self).eq(other) } } @@ -149,129 +131,6 @@ enum def { } impl def : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &def) -> bool { - match self { - def_fn(e0a, e1a) => { - match (*other) { - def_fn(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_static_method(e0a, e1a, e2a) => { - match (*other) { - def_static_method(e0b, e1b, e2b) => - e0a == e0b && e1a == e1b && e2a == e2b, - _ => false - } - } - def_self(e0a) => { - match (*other) { - def_self(e0b) => e0a == e0b, - _ => false - } - } - def_mod(e0a) => { - match (*other) { - def_mod(e0b) => e0a == e0b, - _ => false - } - } - def_foreign_mod(e0a) => { - match (*other) { - def_foreign_mod(e0b) => e0a == e0b, - _ => false - } - } - def_const(e0a) => { - match (*other) { - def_const(e0b) => e0a == e0b, - _ => false - } - } - def_arg(e0a, e1a) => { - match (*other) { - def_arg(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_local(e0a, e1a) => { - match (*other) { - def_local(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_variant(e0a, e1a) => { - match (*other) { - def_variant(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_ty(e0a) => { - match (*other) { - def_ty(e0b) => e0a == e0b, - _ => false - } - } - def_prim_ty(e0a) => { - match (*other) { - def_prim_ty(e0b) => e0a == e0b, - _ => false - } - } - def_ty_param(e0a, e1a) => { - match (*other) { - def_ty_param(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_binding(e0a, e1a) => { - match (*other) { - def_binding(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_use(e0a) => { - match (*other) { - def_use(e0b) => e0a == e0b, - _ => false - } - } - def_upvar(e0a, e1a, e2a, e3a) => { - match (*other) { - def_upvar(e0b, e1b, e2b, e3b) => - e0a == e0b && e1a == e1b && e2a == e2b && e3a == e3b, - _ => false - } - } - def_class(e0a) => { - match (*other) { - def_class(e0b) => e0a == e0b, - _ => false - } - } - def_typaram_binder(e0a) => { - match (*other) { - def_typaram_binder(e1a) => e0a == e1a, - _ => false - } - } - def_region(e0a) => { - match (*other) { - def_region(e0b) => e0a == e0b, - _ => false - } - } - def_label(e0a) => { - match (*other) { - def_label(e0b) => e0a == e0b, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &def) -> bool { match (*self) { def_fn(e0a, e1a) => { @@ -392,10 +251,6 @@ impl def : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &def) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &def) -> bool { !(*self).eq(other) } } @@ -464,37 +319,6 @@ impl binding_mode : to_bytes::IterBytes { } impl binding_mode : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &binding_mode) -> bool { - match self { - bind_by_value => { - match (*other) { - bind_by_value => true, - _ => false - } - } - bind_by_move => { - match (*other) { - bind_by_move => true, - _ => false - } - } - bind_by_ref(e0a) => { - match (*other) { - bind_by_ref(e0b) => e0a == e0b, - _ => false - } - } - bind_by_implicit_ref => { - match (*other) { - bind_by_implicit_ref => true, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &binding_mode) -> bool { match (*self) { bind_by_value => { @@ -523,10 +347,6 @@ impl binding_mode : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &binding_mode) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &binding_mode) -> bool { !(*self).eq(other) } } @@ -565,19 +385,9 @@ impl mutability : to_bytes::IterBytes { } impl mutability : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &mutability) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &mutability) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &mutability) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &mutability) -> bool { !(*self).eq(other) } } @@ -591,19 +401,9 @@ pub enum Proto { } impl Proto : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &Proto) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &Proto) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &Proto) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &Proto) -> bool { !(*self).eq(other) } } @@ -664,19 +464,9 @@ enum binop { } impl binop : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &binop) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &binop) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &binop) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &binop) -> bool { !(*self).eq(other) } } @@ -691,43 +481,6 @@ enum unop { } impl unop : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &unop) -> bool { - match self { - box(e0a) => { - match (*other) { - box(e0b) => e0a == e0b, - _ => false - } - } - uniq(e0a) => { - match (*other) { - uniq(e0b) => e0a == e0b, - _ => false - } - } - deref => { - match (*other) { - deref => true, - _ => false - } - } - not => { - match (*other) { - not => true, - _ => false - } - } - neg => { - match (*other) { - neg => true, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &unop) -> bool { match (*self) { box(e0a) => { @@ -762,12 +515,6 @@ impl unop : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &unop) -> bool { - !self.eq(other) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &unop) -> bool { !(*self).eq(other) } @@ -795,25 +542,6 @@ impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes { } impl<T:cmp::Eq> inferable<T> : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &inferable<T>) -> bool { - match self { - expl(e0a) => { - match (*other) { - expl(e0b) => e0a == e0b, - _ => false - } - } - infer(e0a) => { - match (*other) { - infer(e0b) => e0a == e0b, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &inferable<T>) -> bool { match (*self) { expl(e0a) => { @@ -830,10 +558,6 @@ impl<T:cmp::Eq> inferable<T> : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &inferable<T>) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &inferable<T>) -> bool { !(*self).eq(other) } } @@ -850,19 +574,9 @@ impl rmode : to_bytes::IterBytes { impl rmode : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &rmode) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &rmode) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &rmode) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &rmode) -> bool { !(*self).eq(other) } } @@ -913,17 +627,6 @@ type field = spanned<field_>; enum blk_check_mode { default_blk, unsafe_blk, } impl blk_check_mode : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &blk_check_mode) -> bool { - match (self, (*other)) { - (default_blk, default_blk) => true, - (unsafe_blk, unsafe_blk) => true, - (default_blk, _) => false, - (unsafe_blk, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &blk_check_mode) -> bool { match ((*self), (*other)) { (default_blk, default_blk) => true, @@ -932,10 +635,6 @@ impl blk_check_mode : cmp::Eq { (unsafe_blk, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &blk_check_mode) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &blk_check_mode) -> bool { !(*self).eq(other) } } @@ -1152,35 +851,6 @@ enum lit_ { } impl ast::lit_: cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &ast::lit_) -> bool { - match (self, *other) { - (lit_str(a), lit_str(b)) => a == b, - (lit_int(val_a, ty_a), lit_int(val_b, ty_b)) => { - val_a == val_b && ty_a == ty_b - } - (lit_uint(val_a, ty_a), lit_uint(val_b, ty_b)) => { - val_a == val_b && ty_a == ty_b - } - (lit_int_unsuffixed(a), lit_int_unsuffixed(b)) => a == b, - (lit_float(val_a, ty_a), lit_float(val_b, ty_b)) => { - val_a == val_b && ty_a == ty_b - } - (lit_float_unsuffixed(a), lit_float_unsuffixed(b)) => a == b, - (lit_nil, lit_nil) => true, - (lit_bool(a), lit_bool(b)) => a == b, - (lit_str(_), _) => false, - (lit_int(*), _) => false, - (lit_uint(*), _) => false, - (lit_int_unsuffixed(*), _) => false, - (lit_float(*), _) => false, - (lit_float_unsuffixed(*), _) => false, - (lit_nil, _) => false, - (lit_bool(_), _) => false - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &ast::lit_) -> bool { match ((*self), *other) { (lit_str(a), lit_str(b)) => a == b, @@ -1207,10 +877,6 @@ impl ast::lit_: cmp::Eq { (lit_bool(_), _) => false } } - #[cfg(stage0)] - pure fn ne(other: &ast::lit_) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &ast::lit_) -> bool { !(*self).eq(other) } } @@ -1253,25 +919,6 @@ impl int_ty : to_bytes::IterBytes { } impl int_ty : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &int_ty) -> bool { - match (self, (*other)) { - (ty_i, ty_i) => true, - (ty_char, ty_char) => true, - (ty_i8, ty_i8) => true, - (ty_i16, ty_i16) => true, - (ty_i32, ty_i32) => true, - (ty_i64, ty_i64) => true, - (ty_i, _) => false, - (ty_char, _) => false, - (ty_i8, _) => false, - (ty_i16, _) => false, - (ty_i32, _) => false, - (ty_i64, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &int_ty) -> bool { match ((*self), (*other)) { (ty_i, ty_i) => true, @@ -1288,10 +935,6 @@ impl int_ty : cmp::Eq { (ty_i64, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &int_ty) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &int_ty) -> bool { !(*self).eq(other) } } @@ -1306,23 +949,6 @@ impl uint_ty : to_bytes::IterBytes { } impl uint_ty : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &uint_ty) -> bool { - match (self, (*other)) { - (ty_u, ty_u) => true, - (ty_u8, ty_u8) => true, - (ty_u16, ty_u16) => true, - (ty_u32, ty_u32) => true, - (ty_u64, ty_u64) => true, - (ty_u, _) => false, - (ty_u8, _) => false, - (ty_u16, _) => false, - (ty_u32, _) => false, - (ty_u64, _) => false - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &uint_ty) -> bool { match ((*self), (*other)) { (ty_u, ty_u) => true, @@ -1337,10 +963,6 @@ impl uint_ty : cmp::Eq { (ty_u64, _) => false } } - #[cfg(stage0)] - pure fn ne(other: &uint_ty) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &uint_ty) -> bool { !(*self).eq(other) } } @@ -1354,25 +976,12 @@ impl float_ty : to_bytes::IterBytes { } } impl float_ty : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &float_ty) -> bool { - match (self, (*other)) { - (ty_f, ty_f) | (ty_f32, ty_f32) | (ty_f64, ty_f64) => true, - (ty_f, _) | (ty_f32, _) | (ty_f64, _) => false - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &float_ty) -> bool { match ((*self), (*other)) { (ty_f, ty_f) | (ty_f32, ty_f32) | (ty_f64, ty_f64) => true, (ty_f, _) | (ty_f32, _) | (ty_f64, _) => false } } - #[cfg(stage0)] - pure fn ne(other: &float_ty) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &float_ty) -> bool { !(*self).eq(other) } } @@ -1392,43 +1001,6 @@ enum prim_ty { } impl prim_ty : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &prim_ty) -> bool { - match self { - ty_int(e0a) => { - match (*other) { - ty_int(e0b) => e0a == e0b, - _ => false - } - } - ty_uint(e0a) => { - match (*other) { - ty_uint(e0b) => e0a == e0b, - _ => false - } - } - ty_float(e0a) => { - match (*other) { - ty_float(e0b) => e0a == e0b, - _ => false - } - } - ty_str => { - match (*other) { - ty_str => true, - _ => false - } - } - ty_bool => { - match (*other) { - ty_bool => true, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &prim_ty) -> bool { match (*self) { ty_int(e0a) => { @@ -1463,10 +1035,6 @@ impl prim_ty : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &prim_ty) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &prim_ty) -> bool { !(*self).eq(other) } } @@ -1491,27 +1059,12 @@ enum Onceness { } impl Onceness : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &Onceness) -> bool { - match (self, *other) { - (Once, Once) | (Many, Many) => true, - _ => false - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &Onceness) -> bool { match ((*self), *other) { (Once, Once) | (Many, Many) => true, _ => false } } - #[cfg(stage0)] - pure fn ne(other: &Onceness) -> bool { - !self.eq(other) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &Onceness) -> bool { !(*self).eq(other) } @@ -1553,21 +1106,9 @@ enum ty_ { // Equality and byte-iter (hashing) can be quite approximate for AST types. // since we only care about this for normalizing them to "real" types. impl Ty : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &Ty) -> bool { - ptr::addr_of(&self) == ptr::addr_of(&(*other)) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &Ty) -> bool { ptr::addr_of(&(*self)) == ptr::addr_of(&(*other)) } - #[cfg(stage0)] - pure fn ne(other: &Ty) -> bool { - ptr::addr_of(&self) != ptr::addr_of(&(*other)) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &Ty) -> bool { ptr::addr_of(&(*self)) != ptr::addr_of(&(*other)) } @@ -1607,19 +1148,9 @@ impl purity : to_bytes::IterBytes { } impl purity : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &purity) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &purity) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &purity) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &purity) -> bool { !(*self).eq(other) } } @@ -1638,17 +1169,6 @@ impl ret_style : to_bytes::IterBytes { } impl ret_style : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &ret_style) -> bool { - match (self, (*other)) { - (noreturn, noreturn) => true, - (return_val, return_val) => true, - (noreturn, _) => false, - (return_val, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &ret_style) -> bool { match ((*self), (*other)) { (noreturn, noreturn) => true, @@ -1657,10 +1177,6 @@ impl ret_style : cmp::Eq { (return_val, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &ret_style) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &ret_style) -> bool { !(*self).eq(other) } } @@ -1676,49 +1192,6 @@ enum self_ty_ { } impl self_ty_ : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &self_ty_) -> bool { - match self { - sty_static => { - match (*other) { - sty_static => true, - _ => false - } - } - sty_by_ref => { - match (*other) { - sty_by_ref => true, - _ => false - } - } - sty_value => { - match (*other) { - sty_value => true, - _ => false - } - } - sty_region(e0a) => { - match (*other) { - sty_region(e0b) => e0a == e0b, - _ => false - } - } - sty_box(e0a) => { - match (*other) { - sty_box(e0b) => e0a == e0b, - _ => false - } - } - sty_uniq(e0a) => { - match (*other) { - sty_uniq(e0b) => e0a == e0b, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &self_ty_) -> bool { match (*self) { sty_static => { @@ -1759,10 +1232,6 @@ impl self_ty_ : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &self_ty_) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &self_ty_) -> bool { !(*self).eq(other) } } @@ -1794,36 +1263,13 @@ enum foreign_abi { enum foreign_mod_sort { named, anonymous } impl foreign_mod_sort : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &foreign_mod_sort) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &foreign_mod_sort) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &foreign_mod_sort) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &foreign_mod_sort) -> bool { !(*self).eq(other) } } impl foreign_abi : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &foreign_abi) -> bool { - match (self, (*other)) { - (foreign_abi_rust_intrinsic, foreign_abi_rust_intrinsic) => true, - (foreign_abi_cdecl, foreign_abi_cdecl) => true, - (foreign_abi_stdcall, foreign_abi_stdcall) => true, - (foreign_abi_rust_intrinsic, _) => false, - (foreign_abi_cdecl, _) => false, - (foreign_abi_stdcall, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &foreign_abi) -> bool { match ((*self), (*other)) { (foreign_abi_rust_intrinsic, foreign_abi_rust_intrinsic) => true, @@ -1834,10 +1280,6 @@ impl foreign_abi : cmp::Eq { (foreign_abi_stdcall, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &foreign_abi) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &foreign_abi) -> bool { !(*self).eq(other) } } @@ -1886,19 +1328,9 @@ type path_list_ident = spanned<path_list_ident_>; enum namespace { module_ns, type_value_ns } impl namespace : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &namespace) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &namespace) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &namespace) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &namespace) -> bool { !(*self).eq(other) } } @@ -1946,19 +1378,9 @@ type attribute = spanned<attribute_>; enum attr_style { attr_outer, attr_inner, } impl attr_style : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &attr_style) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &attr_style) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &attr_style) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &attr_style) -> bool { !(*self).eq(other) } } @@ -1985,19 +1407,6 @@ type trait_ref = {path: @path, ref_id: node_id, impl_id: node_id}; enum visibility { public, private, inherited } impl visibility : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &visibility) -> bool { - match (self, (*other)) { - (public, public) => true, - (private, private) => true, - (inherited, inherited) => true, - (public, _) => false, - (private, _) => false, - (inherited, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &visibility) -> bool { match ((*self), (*other)) { (public, public) => true, @@ -2008,10 +1417,6 @@ impl visibility : cmp::Eq { (inherited, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &visibility) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &visibility) -> bool { !(*self).eq(other) } } @@ -2033,30 +1438,6 @@ enum struct_field_kind { } impl struct_field_kind : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &struct_field_kind) -> bool { - match self { - named_field(ident_a, class_mutability_a, visibility_a) => { - match *other { - named_field(ident_b, class_mutability_b, visibility_b) - => { - ident_a == ident_b && - class_mutability_a == class_mutability_b && - visibility_a == visibility_b - } - unnamed_field => false - } - } - unnamed_field => { - match *other { - named_field(*) => false, - unnamed_field => true - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &struct_field_kind) -> bool { match (*self) { named_field(ident_a, class_mutability_a, visibility_a) => { @@ -2078,12 +1459,6 @@ impl struct_field_kind : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &struct_field_kind) -> bool { - !self.eq(other) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &struct_field_kind) -> bool { !(*self).eq(other) } @@ -2142,17 +1517,6 @@ impl class_mutability : to_bytes::IterBytes { } impl class_mutability : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &class_mutability) -> bool { - match (self, (*other)) { - (class_mutable, class_mutable) => true, - (class_immutable, class_immutable) => true, - (class_mutable, _) => false, - (class_immutable, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &class_mutability) -> bool { match ((*self), (*other)) { (class_mutable, class_mutable) => true, @@ -2161,10 +1525,6 @@ impl class_mutability : cmp::Eq { (class_immutable, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &class_mutability) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &class_mutability) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 859f5f1d502..3251ea5d2e9 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -12,25 +12,6 @@ enum path_elt { } impl path_elt : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &path_elt) -> bool { - match self { - path_mod(e0a) => { - match (*other) { - path_mod(e0b) => e0a == e0b, - _ => false - } - } - path_name(e0a) => { - match (*other) { - path_name(e0b) => e0a == e0b, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &path_elt) -> bool { match (*self) { path_mod(e0a) => { @@ -47,10 +28,6 @@ impl path_elt : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &path_elt) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &path_elt) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 94d78d0c55f..468704c9aff 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -338,19 +338,9 @@ enum inline_attr { } impl inline_attr : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &inline_attr) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &inline_attr) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &inline_attr) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &inline_attr) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index fafcd09e3dc..2b77c805791 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -37,29 +37,11 @@ impl BytePos: Pos { pure fn to_uint(&self) -> uint { **self } } -#[cfg(stage0)] -impl BytePos: cmp::Eq { - pure fn eq(other: &BytePos) -> bool { *self == **other } - pure fn ne(other: &BytePos) -> bool { !self.eq(other) } -} - -#[cfg(stage1)] -#[cfg(stage2)] impl BytePos: cmp::Eq { pure fn eq(&self, other: &BytePos) -> bool { **self == **other } pure fn ne(&self, other: &BytePos) -> bool { !(*self).eq(other) } } -#[cfg(stage0)] -impl BytePos: cmp::Ord { - pure fn lt(other: &BytePos) -> bool { *self < **other } - pure fn le(other: &BytePos) -> bool { *self <= **other } - pure fn ge(other: &BytePos) -> bool { *self >= **other } - pure fn gt(other: &BytePos) -> bool { *self > **other } -} - -#[cfg(stage1)] -#[cfg(stage2)] impl BytePos: cmp::Ord { pure fn lt(&self, other: &BytePos) -> bool { **self < **other } pure fn le(&self, other: &BytePos) -> bool { **self <= **other } @@ -101,29 +83,11 @@ impl CharPos: Pos { pure fn to_uint(&self) -> uint { **self } } -#[cfg(stage0)] -impl CharPos: cmp::Eq { - pure fn eq(other: &CharPos) -> bool { *self == **other } - pure fn ne(other: &CharPos) -> bool { !self.eq(other) } -} - -#[cfg(stage1)] -#[cfg(stage2)] impl CharPos: cmp::Eq { pure fn eq(&self, other: &CharPos) -> bool { **self == **other } pure fn ne(&self, other: &CharPos) -> bool { !(*self).eq(other) } } -#[cfg(stage0)] -impl CharPos: cmp::Ord { - pure fn lt(other: &CharPos) -> bool { *self < **other } - pure fn le(other: &CharPos) -> bool { *self <= **other } - pure fn ge(other: &CharPos) -> bool { *self >= **other } - pure fn gt(other: &CharPos) -> bool { *self > **other } -} - -#[cfg(stage1)] -#[cfg(stage2)] impl CharPos: cmp::Ord { pure fn lt(&self, other: &CharPos) -> bool { **self < **other } pure fn le(&self, other: &CharPos) -> bool { **self <= **other } @@ -173,19 +137,9 @@ pub struct span { } impl span : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &span) -> bool { - return self.lo == (*other).lo && self.hi == (*other).hi; - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &span) -> bool { return (*self).lo == (*other).lo && (*self).hi == (*other).hi; } - #[cfg(stage0)] - pure fn ne(other: &span) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &span) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index a362c766c77..8784b3837f1 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -149,19 +149,9 @@ enum level { } impl level : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &level) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &level) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &level) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &level) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 23e18478536..18caef0f72f 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -6,17 +6,6 @@ use ast_builder::{path, append_types}; enum direction { send, recv } impl direction : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &direction) -> bool { - match (self, (*other)) { - (send, send) => true, - (recv, recv) => true, - (send, _) => false, - (recv, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &direction) -> bool { match ((*self), (*other)) { (send, send) => true, @@ -25,10 +14,6 @@ impl direction : cmp::Eq { (recv, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &direction) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &direction) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 3cb6b08d976..4f7bfb0d4e9 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -20,21 +20,9 @@ enum cmnt_style { } impl cmnt_style : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &cmnt_style) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &cmnt_style) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &cmnt_style) -> bool { - (self as uint) != ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &cmnt_style) -> bool { ((*self) as uint) != ((*other) as uint) } diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 40df4d5f7d4..4304c01fdb6 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -29,21 +29,9 @@ pub enum ObsoleteSyntax { } impl ObsoleteSyntax : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &ObsoleteSyntax) -> bool { - self as uint == (*other) as uint - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &ObsoleteSyntax) -> bool { (*self) as uint == (*other) as uint } - #[cfg(stage0)] - pure fn ne(other: &ObsoleteSyntax) -> bool { - !self.eq(other) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &ObsoleteSyntax) -> bool { !(*self).eq(other) } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 382b572f33e..921fcfccc28 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3747,19 +3747,9 @@ impl Parser { } impl restriction : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &restriction) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &restriction) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &restriction) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &restriction) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2e59d2fa45f..3ee99c16e49 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -463,294 +463,13 @@ fn reserved_keyword_table() -> HashMap<~str, ()> { } impl binop : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &binop) -> bool { - (self as uint) == ((*other) as uint) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &binop) -> bool { ((*self) as uint) == ((*other) as uint) } - #[cfg(stage0)] - pure fn ne(other: &binop) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &binop) -> bool { !(*self).eq(other) } } impl Token : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &Token) -> bool { - match self { - EQ => { - match (*other) { - EQ => true, - _ => false - } - } - LT => { - match (*other) { - LT => true, - _ => false - } - } - LE => { - match (*other) { - LE => true, - _ => false - } - } - EQEQ => { - match (*other) { - EQEQ => true, - _ => false - } - } - NE => { - match (*other) { - NE => true, - _ => false - } - } - GE => { - match (*other) { - GE => true, - _ => false - } - } - GT => { - match (*other) { - GT => true, - _ => false - } - } - ANDAND => { - match (*other) { - ANDAND => true, - _ => false - } - } - OROR => { - match (*other) { - OROR => true, - _ => false - } - } - NOT => { - match (*other) { - NOT => true, - _ => false - } - } - TILDE => { - match (*other) { - TILDE => true, - _ => false - } - } - BINOP(e0a) => { - match (*other) { - BINOP(e0b) => e0a == e0b, - _ => false - } - } - BINOPEQ(e0a) => { - match (*other) { - BINOPEQ(e0b) => e0a == e0b, - _ => false - } - } - AT => { - match (*other) { - AT => true, - _ => false - } - } - DOT => { - match (*other) { - DOT => true, - _ => false - } - } - DOTDOT => { - match (*other) { - DOTDOT => true, - _ => false - } - } - ELLIPSIS => { - match (*other) { - ELLIPSIS => true, - _ => false - } - } - COMMA => { - match (*other) { - COMMA => true, - _ => false - } - } - SEMI => { - match (*other) { - SEMI => true, - _ => false - } - } - COLON => { - match (*other) { - COLON => true, - _ => false - } - } - MOD_SEP => { - match (*other) { - MOD_SEP => true, - _ => false - } - } - RARROW => { - match (*other) { - RARROW => true, - _ => false - } - } - LARROW => { - match (*other) { - LARROW => true, - _ => false - } - } - DARROW => { - match (*other) { - DARROW => true, - _ => false - } - } - FAT_ARROW => { - match (*other) { - FAT_ARROW => true, - _ => false - } - } - LPAREN => { - match (*other) { - LPAREN => true, - _ => false - } - } - RPAREN => { - match (*other) { - RPAREN => true, - _ => false - } - } - LBRACKET => { - match (*other) { - LBRACKET => true, - _ => false - } - } - RBRACKET => { - match (*other) { - RBRACKET => true, - _ => false - } - } - LBRACE => { - match (*other) { - LBRACE => true, - _ => false - } - } - RBRACE => { - match (*other) { - RBRACE => true, - _ => false - } - } - POUND => { - match (*other) { - POUND => true, - _ => false - } - } - DOLLAR => { - match (*other) { - DOLLAR => true, - _ => false - } - } - LIT_INT(e0a, e1a) => { - match (*other) { - LIT_INT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - LIT_UINT(e0a, e1a) => { - match (*other) { - LIT_UINT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - LIT_INT_UNSUFFIXED(e0a) => { - match (*other) { - LIT_INT_UNSUFFIXED(e0b) => e0a == e0b, - _ => false - } - } - LIT_FLOAT(e0a, e1a) => { - match (*other) { - LIT_FLOAT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - LIT_FLOAT_UNSUFFIXED(e0a) => { - match (*other) { - LIT_FLOAT_UNSUFFIXED(e0b) => e0a == e0b, - _ => false - } - } - LIT_STR(e0a) => { - match (*other) { - LIT_STR(e0b) => e0a == e0b, - _ => false - } - } - IDENT(e0a, e1a) => { - match (*other) { - IDENT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - UNDERSCORE => { - match (*other) { - UNDERSCORE => true, - _ => false - } - } - INTERPOLATED(_) => { - match (*other) { - INTERPOLATED(_) => true, - _ => false - } - } - DOC_COMMENT(e0a) => { - match (*other) { - DOC_COMMENT(e0b) => e0a == e0b, - _ => false - } - } - EOF => { - match (*other) { - EOF => true, - _ => false - } - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &Token) -> bool { match (*self) { EQ => { @@ -1019,10 +738,6 @@ impl Token : cmp::Eq { } } } - #[cfg(stage0)] - pure fn ne(other: &Token) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &Token) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index e4bd3e92cc4..014d564b84e 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -56,17 +56,6 @@ use dvec::DVec; enum breaks { consistent, inconsistent, } impl breaks : cmp::Eq { - #[cfg(stage0)] - pure fn eq(other: &breaks) -> bool { - match (self, (*other)) { - (consistent, consistent) => true, - (inconsistent, inconsistent) => true, - (consistent, _) => false, - (inconsistent, _) => false, - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &breaks) -> bool { match ((*self), (*other)) { (consistent, consistent) => true, @@ -75,10 +64,6 @@ impl breaks : cmp::Eq { (inconsistent, _) => false, } } - #[cfg(stage0)] - pure fn ne(other: &breaks) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &breaks) -> bool { !(*self).eq(other) } } diff --git a/src/libsyntax/syntax.rc b/src/libsyntax/syntax.rc index afd961f22fc..d5a28a716ec 100644 --- a/src/libsyntax/syntax.rc +++ b/src/libsyntax/syntax.rc @@ -1,5 +1,3 @@ -// DIVERT - #[link(name = "syntax", vers = "0.5", uuid = "9311401b-d6ea-4cd9-a1d9-61f89499c645")]; @@ -42,116 +40,89 @@ mod fold; mod util { #[legacy_exports]; #[legacy_exports] + #[path = "util/interner.rs"] mod interner; } -mod parse { - #[legacy_exports]; - export parser; - export common; - export lexer; - export token; - export comments; - export prec; - export classify; - export attr; - - #[legacy_exports] - mod lexer; - #[legacy_exports] - mod parser; - #[legacy_exports] - mod token; - #[legacy_exports] - mod comments; - #[legacy_exports] - mod attr; - #[legacy_exports] - - /// Common routines shared by parser mods - #[legacy_exports] - mod common; - - /// Functions dealing with operator precedence - #[legacy_exports] - mod prec; - - /// Routines the parser uses to classify AST nodes - #[legacy_exports] - mod classify; - - /// Reporting obsolete syntax - #[legacy_exports] - mod obsolete; -} +#[merge = "parse/mod.rs"] +mod parse; mod print { #[legacy_exports]; #[legacy_exports] + #[path = "print/pp.rs"] mod pp; #[legacy_exports] + #[path = "print/pprust.rs"] mod pprust; } mod ext { #[legacy_exports]; #[legacy_exports] + #[path = "ext/base.rs"] mod base; #[legacy_exports] + #[path = "ext/expand.rs"] mod expand; #[legacy_exports] + #[path = "ext/qquote.rs"] mod qquote; + #[path = "ext/quote.rs"] mod quote; + #[path = "ext/deriving.rs"] mod deriving; #[legacy_exports] + #[path = "ext/build.rs"] mod build; mod tt { #[legacy_exports]; #[legacy_exports] + #[path = "ext/tt/transcribe.rs"] mod transcribe; #[legacy_exports] + #[path = "ext/tt/macro_parser.rs"] mod macro_parser; #[legacy_exports] + #[path = "ext/tt/macro_rules.rs"] mod macro_rules; } #[legacy_exports] + #[path = "ext/simplext.rs"] mod simplext; #[legacy_exports] + #[path = "ext/fmt.rs"] mod fmt; #[legacy_exports] + #[path = "ext/env.rs"] mod env; #[legacy_exports] + #[path = "ext/concat_idents.rs"] mod concat_idents; #[legacy_exports] + #[path = "ext/ident_to_str.rs"] mod ident_to_str; #[legacy_exports] + #[path = "ext/log_syntax.rs"] mod log_syntax; #[legacy_exports] + #[path = "ext/auto_serialize.rs"] mod auto_serialize; #[legacy_exports] + #[path = "ext/source_util.rs"] mod source_util; - mod pipes { - #[legacy_exports]; - #[legacy_exports] - mod ast_builder; - #[legacy_exports] - mod parse_proto; - #[legacy_exports] - mod pipec; - #[legacy_exports] - mod proto; - #[legacy_exports] - mod check; - #[legacy_exports] - mod liveness; - } + #[legacy_exports] + #[path = "ext/pipes.rs"] + #[merge = "ext/pipes/mod.rs"] + mod pipes; #[legacy_exports] + #[path = "ext/trace_macros.rs"] mod trace_macros; } |
