Skip to content

Commit f72573c

Browse files
committed
Properly pretty-print 10.x
Closes #890
1 parent e64e979 commit f72573c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/comp/syntax/print/pprust.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,15 @@ fn print_expr(s: ps, expr: @ast::expr) {
965965
print_expr(s, rhs);
966966
}
967967
ast::expr_field(expr, id) {
968-
print_expr_parens_if_unary_or_ret(s, expr);
968+
// Deal with '10.x'
969+
alt expr.node {
970+
ast::expr_lit(@{node: ast::lit_int(_), _}) {
971+
popen(s); print_expr(s, expr); pclose(s);
972+
}
973+
_ {
974+
print_expr_parens_if_unary_or_ret(s, expr);
975+
}
976+
}
969977
word(s.s, ".");
970978
word(s.s, id);
971979
}

0 commit comments

Comments
 (0)