diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-06-22 18:19:35 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-06-22 18:57:20 -0700 |
| commit | f60cdf27e76f9e8c195246e90bfd944680cd7617 (patch) | |
| tree | 4bd8e42e9958202e1e1a794aff96c20eedc0c715 /src/libsyntax | |
| parent | 3ed8561dea681fe15eac4c12010c6ede0840088c (diff) | |
| download | rust-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.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 8 |
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); |
