summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2012-07-13 15:24:41 -0700
committerMichael Sullivan <sully@msully.net>2012-07-13 17:03:54 -0700
commitf5e69d611e83c392cb83837ed3e6e440cc180d63 (patch)
tree3f18cfd3461f8e2b777e2a15f2ba13f457158bf6 /src/libsyntax/print
parent985b52be6df504ce6dcef29df61ea20ab9c9323f (diff)
downloadrust-f5e69d611e83c392cb83837ed3e6e440cc180d63.tar.gz
rust-f5e69d611e83c392cb83837ed3e6e440cc180d63.zip
Change the pretty printer to print vstores for strs in prefix notation.
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index c802e40dd05..c0cbf78c5cf 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -379,18 +379,15 @@ fn print_type_ex(s: ps, &&ty: @ast::ty, print_colons: bool) {
         word(s.s, constrs_str(cs, ty_constr_to_str));
       }
       ast::ty_vstore(t, v) {
-        // If it is a vector, print it in prefix notation.
-        // Someday it will all be like this.
-        let is_fixed = alt v { ast::vstore_fixed(_) { true } _ { false } };
-        alt t.node {
-          ast::ty_vec(*) if !is_fixed {
-            print_vstore(s, v);
+        alt v {
+          ast::vstore_fixed(_) {
             print_type(s, t);
+            word(s.s, "/");
+            print_vstore(s, v);
           }
           _ {
-            print_type(s, t);
-            word(s.s, "/");
             print_vstore(s, v);
+            print_type(s, t);
           }
         }
       }
@@ -888,18 +885,15 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
     s.ann.pre(ann_node);
     alt expr.node {
       ast::expr_vstore(e, v) {
-        // If it is a vector, print it in prefix notation.
-        // Someday it will all be like this.
-        let is_fixed = alt v { ast::vstore_fixed(_) { true } _ { false } };
-        alt e.node {
-          ast::expr_vec(*) if !is_fixed {
-            print_vstore(s, v);
+        alt v {
+          ast::vstore_fixed(_) {
             print_expr(s, e);
+            word(s.s, "/");
+            print_vstore(s, v);
           }
           _ {
-            print_expr(s, e);
-            word(s.s, "/");
             print_vstore(s, v);
+            print_expr(s, e);
           }
         }
       }