summary refs log tree commit diff
path: root/src/comp/syntax/print/pprust.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-02-15 11:25:39 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-02-15 13:26:11 -0800
commitbfff2a8d55f8d96df77c7e496dc7713fe7faf5f9 (patch)
tree23c1e0515c6894f15bbd9c5b473f7f4e2653965d /src/comp/syntax/print/pprust.rs
parentdddd9908d537ce2858f37783779c3b88005ff0a8 (diff)
downloadrust-bfff2a8d55f8d96df77c7e496dc7713fe7faf5f9.tar.gz
rust-bfff2a8d55f8d96df77c7e496dc7713fe7faf5f9.zip
make mut a keyword synonymous with mutable
first step towards issue #1273
Diffstat (limited to 'src/comp/syntax/print/pprust.rs')
-rw-r--r--src/comp/syntax/print/pprust.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index 23cea66e8db..343b4500a3d 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -318,10 +318,10 @@ fn print_type(s: ps, &&ty: @ast::ty) {
       ast::ty_uniq(mt) { word(s.s, "~"); print_mt(s, mt); }
       ast::ty_vec(mt) {
         word(s.s, "[");
-        alt mt.mut {
-          ast::mut { word_space(s, "mutable"); }
-          ast::maybe_mut { word_space(s, "const"); }
-          ast::imm { }
+        alt mt.mutbl {
+          ast::m_mutbl { word_space(s, "mut"); }
+          ast::m_const { word_space(s, "const"); }
+          ast::m_imm { }
         }
         print_type(s, mt.ty);
         word(s.s, "]");
@@ -331,7 +331,7 @@ fn print_type(s: ps, &&ty: @ast::ty) {
         word(s.s, "{");
         fn print_field(s: ps, f: ast::ty_field) {
             cbox(s, indent_unit);
-            print_mutability(s, f.node.mt.mut);
+            print_mutability(s, f.node.mt.mutbl);
             word(s.s, f.node.ident);
             word_space(s, ":");
             print_type(s, f.node.mt.ty);
@@ -785,10 +785,10 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
     let ann_node = node_expr(s, expr);
     s.ann.pre(ann_node);
     alt expr.node {
-      ast::expr_vec(exprs, mut) {
+      ast::expr_vec(exprs, mutbl) {
         ibox(s, indent_unit);
         word(s.s, "[");
-        if mut == ast::mut {
+        if mutbl == ast::m_mutbl {
             word(s.s, "mutable");
             if vec::len(exprs) > 0u { nbsp(s); }
         }
@@ -799,7 +799,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
       ast::expr_rec(fields, wth) {
         fn print_field(s: ps, field: ast::field) {
             ibox(s, indent_unit);
-            if field.node.mut == ast::mut { word_nbsp(s, "mutable"); }
+            if field.node.mutbl == ast::m_mutbl { word_nbsp(s, "mutable"); }
             word(s.s, field.node.ident);
             word_space(s, ":");
             print_expr(s, field.node.expr);
@@ -1274,7 +1274,7 @@ fn print_fn_block_args(s: ps, decl: ast::fn_decl) {
 
 fn mode_to_str(m: ast::mode) -> str {
     alt m {
-      ast::expl(ast::by_mut_ref) { "&" }
+      ast::expl(ast::by_mutbl_ref) { "&" }
       ast::expl(ast::by_move) { "-" }
       ast::expl(ast::by_ref) { "&&" }
       ast::expl(ast::by_val) { "++" }
@@ -1436,16 +1436,16 @@ fn print_op_maybe_parens(s: ps, expr: @ast::expr, outer_prec: int) {
     if add_them { pclose(s); }
 }
 
-fn print_mutability(s: ps, mut: ast::mutability) {
-    alt mut {
-      ast::mut { word_nbsp(s, "mutable"); }
-      ast::maybe_mut { word_nbsp(s, "const"); }
-      ast::imm {/* nothing */ }
+fn print_mutability(s: ps, mutbl: ast::mutability) {
+    alt mutbl {
+      ast::m_mutbl { word_nbsp(s, "mutable"); }
+      ast::m_const { word_nbsp(s, "const"); }
+      ast::m_imm {/* nothing */ }
     }
 }
 
 fn print_mt(s: ps, mt: ast::mt) {
-    print_mutability(s, mt.mut);
+    print_mutability(s, mt.mutbl);
     print_type(s, mt.ty);
 }