Make the pretty-printer output new-style syntax for local decls

This commit is contained in:
Marijn Haverbeke 2011-07-26 10:40:28 +02:00
parent 252b8ffe42
commit ce808bbc6f
2 changed files with 8 additions and 11 deletions

View File

@ -170,7 +170,6 @@ fn bad_expr_word_table() -> hashmap[str, ()] {
words.insert("state", ());
words.insert("gc", ());
words.insert("native", ());
words.insert("auto", ());
words.insert("fn", ());
words.insert("pred", ());
words.insert("iter", ());

View File

@ -1052,18 +1052,16 @@ fn print_decl(&ps s, &@ast::decl decl) {
case (ast::decl_local(?locs)) {
space_if_not_hardbreak(s);
ibox(s, indent_unit);
alt (locs.(0).node.ty) {
case (some(?ty)) {
word_nbsp(s, "let");
print_type(s, *ty);
space(s.s);
}
case (_) {
word_nbsp(s, "auto");
}
}
word_nbsp(s, "let");
fn print_local(&ps s, &@ast::local loc) {
word(s.s, loc.node.ident);
alt (loc.node.ty) {
some(?ty) {
word_space(s, ":");
print_type(s, *ty);
}
_ {}
}
alt loc.node.init {
some(?init) {
space(s.s);