Skip to content

Commit c051501

Browse files
committed
Tighten up the hardbreak rules a bit.
1 parent 8cd0695 commit c051501

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/comp/pretty/pp.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,9 @@ fn word(printer p, str wrd) {
502502
p.pretty_print(STRING(wrd, str::char_len(wrd) as int));
503503
}
504504

505-
fn huge_word(printer p, str wrd) { p.pretty_print(STRING(wrd, 0xffff)); }
505+
fn huge_word(printer p, str wrd) {
506+
p.pretty_print(STRING(wrd, size_infinity));
507+
}
506508

507509
fn zero_word(printer p, str wrd) { p.pretty_print(STRING(wrd, 0)); }
508510

@@ -512,10 +514,10 @@ fn zerobreak(printer p) { spaces(p, 0u); }
512514

513515
fn space(printer p) { spaces(p, 1u); }
514516

515-
fn hardbreak(printer p) { spaces(p, 0xffffu); }
517+
fn hardbreak(printer p) { spaces(p, size_infinity as uint); }
516518

517519
fn hardbreak_tok() -> token {
518-
ret BREAK(rec(offset=0, blank_space=0xffff));
520+
ret BREAK(rec(offset=0, blank_space=size_infinity));
519521
}
520522

521523
//

src/comp/pretty/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ fn print_mod(&ps s, ast::_mod _mod) {
183183
}
184184
for (@ast::item item in _mod.items) {
185185
// Mod-level item printing we're a little more space-y about.
186-
187-
hardbreak_if_not_bol(s);
186+
hardbreak(s.s);
187+
hardbreak(s.s);
188188
print_item(s, item);
189189
}
190190
print_remaining_comments(s);

0 commit comments

Comments
 (0)