about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-06-22 18:19:35 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-06-22 18:57:20 -0700
commitf60cdf27e76f9e8c195246e90bfd944680cd7617 (patch)
tree4bd8e42e9958202e1e1a794aff96c20eedc0c715 /src/libsyntax
parent3ed8561dea681fe15eac4c12010c6ede0840088c (diff)
downloadrust-f60cdf27e76f9e8c195246e90bfd944680cd7617.tar.gz
rust-f60cdf27e76f9e8c195246e90bfd944680cd7617.zip
Remove 'implements' keyword in favour of :, part of #2301.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/libsyntax/parse/token.rs1
-rw-r--r--src/libsyntax/print/pprust.rs8
3 files changed, 6 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 46e838fd4be..28fee93fad7 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1979,7 +1979,7 @@ class parser {
         let rp = self.parse_region_param();
         let ty_params = self.parse_ty_params();
         let class_path = self.ident_to_path_tys(class_name, rp, ty_params);
-        let ifaces : [@iface_ref] = if self.eat_keyword("implements")
+        let ifaces : [@iface_ref] = if self.eat(token::COLON)
             { self.parse_iface_ref_list() }
         else { [] };
         self.expect(token::LBRACE);
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 39327f1efad..0a166dceb1d 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -251,7 +251,6 @@ fn contextual_keyword_table() -> hashmap<str, ()> {
     let keys = [
         "as",
         "else",
-        "implements",
         "move",
         "of",
         "priv", "pub",
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 89f3b2d3aba..f632f3bcc21 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -527,9 +527,11 @@ fn print_item(s: ps, &&item: @ast::item) {
           word_nbsp(s, *item.ident);
           print_region_param(s, rp);
           print_type_params(s, tps);
-          word_space(s, "implements");
-          commasep(s, inconsistent, ifaces, {|s, p|
-                      print_path(s, p.path, false)});
+          if vec::len(ifaces) != 0u {
+              word_space(s, ":");
+              commasep(s, inconsistent, ifaces, {|s, p|
+                  print_path(s, p.path, false)});
+          }
           bopen(s);
           hardbreak_if_not_bol(s);
           maybe_print_comment(s, ctor.span.lo);