Skip to content

Commit f5e157e

Browse files
committed
---
yaml --- r: 3271 b: refs/heads/master c: 8cd0695 h: refs/heads/master i: 3269: 0b7652a 3267: 8c16812 3263: 4275550 v: v3
1 parent c6e82db commit f5e157e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 035d60d533d4c34c9837951bdc819c498992dcba
2+
refs/heads/master: 8cd0695230fa234306084186f7c96435e7f61495

trunk/src/comp/pretty/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn print_comment(&ps s, lexer::cmnt cmnt) {
235235
zerobreak(s.s);
236236
}
237237
case (lexer::isolated) {
238-
pprust::hardbreak_if_not_eof(s);
238+
pprust::hardbreak_if_not_bol(s);
239239
for (str line in cmnt.lines) { word(s.s, line); hardbreak(s.s); }
240240
}
241241
case (lexer::trailing) {

trunk/src/comp/pretty/pprust.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ fn bclose(&ps s, common::span span) {
120120

121121
}
122122

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()) {
125126
hardbreak(s.s);
126127
}
127128
}
@@ -183,7 +184,7 @@ fn print_mod(&ps s, ast::_mod _mod) {
183184
for (@ast::item item in _mod.items) {
184185
// Mod-level item printing we're a little more space-y about.
185186

186-
hardbreak_if_not_eof(s);
187+
hardbreak_if_not_bol(s);
187188
print_item(s, item);
188189
}
189190
print_remaining_comments(s);
@@ -271,7 +272,7 @@ fn print_type(&ps s, &ast::ty ty) {
271272
}
272273

273274
fn print_item(&ps s, &@ast::item item) {
274-
hardbreak_if_not_eof(s);
275+
hardbreak_if_not_bol(s);
275276
maybe_print_comment(s, item.span.lo);
276277
print_outer_attributes(s, item.attrs);
277278
alt (item.node) {
@@ -1025,7 +1026,7 @@ fn print_meta_item(&ps s, &@ast::meta_item item) {
10251026
}
10261027

10271028
fn print_view_item(&ps s, &@ast::view_item item) {
1028-
hardbreak_if_not_eof(s);
1029+
hardbreak_if_not_bol(s);
10291030
maybe_print_comment(s, item.span.lo);
10301031
alt (item.node) {
10311032
case (ast::view_item_use(?id, ?mta, _, _)) {

0 commit comments

Comments
 (0)