about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2012-10-09 19:42:26 +0200
committerBrian Anderson <banderson@mozilla.com>2012-10-20 17:50:46 -0700
commit4174688dd48f4967e08c0aecc7a2a90dc28a56da (patch)
tree94115394d533b72ec6fe550d26a65dc0ddfe9227 /src/libsyntax
parent55e40a167426a7e28fc334286ef2b5c47c46e6fd (diff)
downloadrust-4174688dd48f4967e08c0aecc7a2a90dc28a56da.tar.gz
rust-4174688dd48f4967e08c0aecc7a2a90dc28a56da.zip
libsyntax: adapt the pretty printer for the new fixed size array syntax
`[int]/5` -> `[int * 5]`
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 3fc2bcda901..807a78b3122 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -399,9 +399,21 @@ fn print_type_ex(s: ps, &&ty: @ast::Ty, print_colons: bool) {
       }
       ast::ty_path(path, _) => print_path(s, path, print_colons),
       ast::ty_fixed_length(t, v) => {
-        print_type(s, t);
-        word(s.s, ~"/");
+        word(s.s, ~"[");
+        match t.node {
+          ast::ty_vec(mt) => {
+            match mt.mutbl {
+              ast::m_mutbl => word_space(s, ~"mut"),
+              ast::m_const => word_space(s, ~"const"),
+              ast::m_imm => ()
+            }
+            print_type(s, mt.ty);
+          }
+          _ => fail ~"ty_fixed_length can only contain ty_vec as type"
+        }
+        word(s.s, ~" * ");
         print_vstore(s, ast::vstore_fixed(v));
+        word(s.s, ~"]");
       }
       ast::ty_mac(_) => {
           fail ~"print_type doesn't know how to print a ty_mac";