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
This commit is contained in:
Tim Chevalier
2012-10-27 17:14:09 -07:00
parent 17a5d0f3a0
commit 62f98c8ff8
20 changed files with 148 additions and 217 deletions

View File

@@ -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]