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);
let keys = [
"as",
"else",
- "implements",
"move",
"of",
"priv", "pub",
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);
mod kitty {
-class cat implements to_str {
+class cat : to_str {
priv {
let mut meows : uint;
fn meow() {
fn speak();
}
-class cat implements noisy {
+class cat : noisy {
priv {
let mut meows : uint;
fn meow() {
// error-pattern:unresolved typename: nonexistent
-class cat implements nonexistent {
+class cat : nonexistent {
let meows: uint;
new(in_x : uint) { self.meows = in_x; }
}
-class cat implements int { //! ERROR can only implement interface types
+class cat : int { //! ERROR can only implement interface types
let meows: uint;
new(in_x : uint) { self.meows = in_x; }
}
fn eat();
}
-class cat implements animal {
+class cat : animal {
let meows: uint;
new(in_x : uint) { self.meows = in_x; }
}
import to_str::*;
import to_str::to_str;
-class cat implements to_str {
+class cat : to_str {
priv {
let mut meows : uint;
fn meow() {
fn speak() -> int;
}
-class dog implements noisy {
+class dog : noisy {
priv {
let barks : @mut uint;
fn bark() -> int {
fn speak() -> int { self.bark() }
}
-class cat implements noisy {
+class cat : noisy {
priv {
let meows : @mut uint;
fn meow() -> uint {
fn speak();
}
-class cat implements noisy {
+class cat : noisy {
priv {
let mut meows : uint;
fn meow() {
import std::map::{map, hashmap, int_hash};
class keys<K: copy, V: copy, M: copy map<K,V>>
- implements iter::base_iter<K> {
+ : iter::base_iter<K> {
let map: M;
use std;
import std::map::*;
-class cat implements map<int, bool> {
+class cat : map<int, bool> {
priv {
// Yes, you can have negative meows
let mut meows : int;
// for any int value that's less than the meows field
// ok: T should be in scope when resolving the iface ref for map
-class cat<T: copy> implements map<int, T> {
+class cat<T: copy> : map<int, T> {
priv {
// Yes, you can have negative meows
let mut meows : int;
use cci_class_iface;
import cci_class_iface::animals::*;
-class cat implements noisy {
+class cat : noisy {
priv {
let mut meows : uint;
fn meow() {
fn speak();
}
-class cat implements noisy {
+class cat : noisy {
priv {
let mut meows : uint;
fn meow() {
}
// vtables other than the 1st one don't seem to work
-class cat implements noisy, scratchy, bitey {
+class cat : noisy, scratchy, bitey {
priv {
let meows : @mut uint;
let scratched : dvec<furniture>;