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

@@ -494,7 +494,8 @@ fn noop_fold_expr(e: expr_, fld: ast_fold) -> expr_ {
expr_struct(fld.fold_path(path),
vec::map(fields, |x| fold_field(*x)),
option::map(&maybe_expr, |x| fld.fold_expr(*x)))
}
},
expr_paren(ex) => expr_paren(fld.fold_expr(ex))
}
}