Make the pretty printer put trailing newlines at the end of files.

This commit is contained in:
Michael Sullivan 2011-08-03 17:52:25 -07:00
parent 9bfbb2bf83
commit 5ea8d7f467
1 changed files with 3 additions and 0 deletions

View File

@ -1368,6 +1368,9 @@ fn maybe_print_trailing_comment(s: &ps, span: codemap::span,
}
fn print_remaining_comments(s: &ps) {
// If there aren't any remaining comments, then we need to manually
// make sure there is a line break at the end.
if option::is_none(next_comment(s)) { hardbreak(s.s); }
while true {
alt next_comment(s) {
some(cmnt) { print_comment(s, cmnt); s.cur_cmnt += 1u; }