syntax: Eliminate 'mutable' keyword. Closes #2254

This commit is contained in:
Brian Anderson 2012-04-21 13:42:54 -07:00
parent 734494a04d
commit 7235f3cee2
9 changed files with 9 additions and 9 deletions

View file

@ -1484,7 +1484,7 @@ fn parse_let(p: parser) -> @ast::decl {
fn parse_instance_var(p:parser, pr: ast::privacy) -> @ast::class_member {
let mut is_mutbl = ast::class_immutable;
let lo = p.span.lo;
if eat_word(p, "mut") || eat_word(p, "mutable") {
if eat_word(p, "mut") {
is_mutbl = ast::class_mutable;
}
if !is_plain_ident(p.token) {

View file

@ -260,7 +260,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
"class", "const", "cont", "copy", "crust", "do", "else",
"enum", "export", "fail", "fn", "for", "if", "iface",
"impl", "import", "let", "log", "loop", "mod",
"mut", "mutable", "native", "new", "pure", "resource",
"mut", "native", "new", "pure", "resource",
"ret", "trait", "type", "unchecked", "unsafe", "while"];
for keys.each {|word|
words.insert(word, ());

View file

@ -12,7 +12,7 @@ class cat {
}
}
let mutable how_hungry : int;
let mut how_hungry : int;
let name : str;
new(in_x : uint, in_y : int, in_name: str)

View file

@ -1,7 +1,7 @@
// error-pattern:unsatisfied precondition
class cat {
priv {
let mutable meows : uint;
let mut meows : uint;
}
let how_hungry : int;

View file

@ -1,7 +1,7 @@
// error-pattern:assigning to immutable field
class cat {
priv {
let mutable meows : uint;
let mut meows : uint;
}
let how_hungry : int;

View file

@ -1,7 +1,7 @@
// error-pattern:assigning to immutable field
class cat {
priv {
let mutable meows : uint;
let mut meows : uint;
}
let how_hungry : int;

View file

@ -15,7 +15,7 @@ class cat implements noisy {
}
}
let mutable how_hungry : int;
let mut how_hungry : int;
let name : str;
new(in_x : uint, in_y : int, in_name: str)

View file

@ -14,7 +14,7 @@ class cat implements noisy {
}
}
let mutable how_hungry : int;
let mut how_hungry : int;
let name : str;
new(in_x : uint, in_y : int, in_name: str)

View file

@ -10,7 +10,7 @@ class cat {
}
}
let mutable how_hungry : int;
let mut how_hungry : int;
let name : str;
new(in_x : uint, in_y : int, in_name: str)