about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-02-08 18:50:12 -0800
committerJohn Clements <clements@racket-lang.org>2013-02-13 15:08:27 -0800
commitded95d2c2891d7ffec1277cb4969ed956ff0bd25 (patch)
treec7f9d0361c7fe77d689c671745a6658971cbe118 /src/libsyntax/parse
parent16da4e15af02f92d4c7e7cfe36344a276096585d (diff)
downloadrust-ded95d2c2891d7ffec1277cb4969ed956ff0bd25.tar.gz
rust-ded95d2c2891d7ffec1277cb4969ed956ff0bd25.zip
deriving_eq for tokens and binops
Note that the replaced definition of equality on tokens
contains a *huge* shortcut on INTERPOLATED tokens (those
that contain ASTs), whereby any two INTERPOLATED tokens
are considered equal. This seems like a really broken
notion of equality, but it appears that the existing
test cases and the compiler don't depend on it. Niko
noticed this, BTW.

Replace long definition of Eq on tokens and binops
w
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/token.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 1f8b04630e2..391e8b04336 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -25,6 +25,7 @@ use std::oldmap::HashMap;
 
 #[auto_encode]
 #[auto_decode]
+#[deriving_eq]
 pub enum binop {
     PLUS,
     MINUS,
@@ -518,12 +519,6 @@ pub fn reserved_keyword_table() -> HashMap<~str, ()> {
     words
 }
 
-impl binop : cmp::Eq {
-    pure fn eq(&self, other: &binop) -> bool {
-        ((*self) as uint) == ((*other) as uint)
-    }
-    pure fn ne(&self, other: &binop) -> bool { !(*self).eq(other) }
-}
 
 impl Token : cmp::Eq {
     pure fn eq(&self, other: &Token) -> bool {