Skip to content

Commit ce808bb

Browse files
committed
Make the pretty-printer output new-style syntax for local decls
1 parent 252b8ff commit ce808bb

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/comp/syntax/parse/parser.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ fn bad_expr_word_table() -> hashmap[str, ()] {
170170
words.insert("state", ());
171171
words.insert("gc", ());
172172
words.insert("native", ());
173-
words.insert("auto", ());
174173
words.insert("fn", ());
175174
words.insert("pred", ());
176175
words.insert("iter", ());

src/comp/syntax/print/pprust.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,18 +1052,16 @@ fn print_decl(&ps s, &@ast::decl decl) {
10521052
case (ast::decl_local(?locs)) {
10531053
space_if_not_hardbreak(s);
10541054
ibox(s, indent_unit);
1055-
alt (locs.(0).node.ty) {
1056-
case (some(?ty)) {
1057-
word_nbsp(s, "let");
1058-
print_type(s, *ty);
1059-
space(s.s);
1060-
}
1061-
case (_) {
1062-
word_nbsp(s, "auto");
1063-
}
1064-
}
1055+
word_nbsp(s, "let");
10651056
fn print_local(&ps s, &@ast::local loc) {
10661057
word(s.s, loc.node.ident);
1058+
alt (loc.node.ty) {
1059+
some(?ty) {
1060+
word_space(s, ":");
1061+
print_type(s, *ty);
1062+
}
1063+
_ {}
1064+
}
10671065
alt loc.node.init {
10681066
some(?init) {
10691067
space(s.s);

0 commit comments

Comments
 (0)