about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-10-27 17:14:09 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-30 15:05:32 -0700
commit62f98c8ff8179c9754718e62285b82b50dfcfe26 (patch)
treec3db0a950f995408ea390f1b1952a24d2b982940 /src/libsyntax/ast.rs
parent17a5d0f3a0a76e172777456cc0f5ed8318149e33 (diff)
downloadrust-62f98c8ff8179c9754718e62285b82b50dfcfe26.tar.gz
rust-62f98c8ff8179c9754718e62285b82b50dfcfe26.zip
Preserve parenthesization in the AST
Maintain explicit "paren" nodes in the AST so we can pretty-print
without having to guess where parens should go. We may revisit this
in the future.

r=graydon
Diffstat (limited to 'src/libsyntax/ast.rs')
-rw-r--r--src/libsyntax/ast.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 60f22f1b844..a3e57716d17 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -744,7 +744,10 @@ enum expr_ {
     expr_struct(@path, ~[field], Option<@expr>),
 
     // A vector literal constructed from one repeated element.
-    expr_repeat(@expr /* element */, @expr /* count */, mutability)
+    expr_repeat(@expr /* element */, @expr /* count */, mutability),
+
+    // No-op: used solely so we can pretty-print faithfully
+    expr_paren(@expr)
 }
 
 #[auto_serialize]