@@ -120,8 +120,9 @@ fn bclose(&ps s, common::span span) {
120
120
121
121
}
122
122
123
- fn hardbreak_if_not_eof ( & ps s) {
124
- if ( s. s . last_token ( ) != pp:: EOF ) {
123
+ fn hardbreak_if_not_bol ( & ps s) {
124
+ if ( s. s . last_token ( ) != pp:: EOF &&
125
+ s. s . last_token ( ) != pp:: hardbreak_tok ( ) ) {
125
126
hardbreak ( s. s ) ;
126
127
}
127
128
}
@@ -183,7 +184,7 @@ fn print_mod(&ps s, ast::_mod _mod) {
183
184
for ( @ast:: item item in _mod. items) {
184
185
// Mod-level item printing we're a little more space-y about.
185
186
186
- hardbreak_if_not_eof ( s) ;
187
+ hardbreak_if_not_bol ( s) ;
187
188
print_item ( s, item) ;
188
189
}
189
190
print_remaining_comments ( s) ;
@@ -271,7 +272,7 @@ fn print_type(&ps s, &ast::ty ty) {
271
272
}
272
273
273
274
fn print_item ( & ps s, & @ast:: item item) {
274
- hardbreak_if_not_eof ( s) ;
275
+ hardbreak_if_not_bol ( s) ;
275
276
maybe_print_comment ( s, item. span . lo ) ;
276
277
print_outer_attributes ( s, item. attrs ) ;
277
278
alt ( item. node ) {
@@ -1025,7 +1026,7 @@ fn print_meta_item(&ps s, &@ast::meta_item item) {
1025
1026
}
1026
1027
1027
1028
fn print_view_item ( & ps s, & @ast:: view_item item) {
1028
- hardbreak_if_not_eof ( s) ;
1029
+ hardbreak_if_not_bol ( s) ;
1029
1030
maybe_print_comment ( s, item. span . lo ) ;
1030
1031
alt ( item. node ) {
1031
1032
case ( ast:: view_item_use ( ?id, ?mta, _, _) ) {
0 commit comments