Tighten up the hardbreak rules a bit.

This commit is contained in:
Graydon Hoare 2011-06-20 17:07:29 +00:00
parent 8cd0695230
commit c051501784
2 changed files with 7 additions and 5 deletions

View File

@ -502,7 +502,9 @@ fn word(printer p, str wrd) {
p.pretty_print(STRING(wrd, str::char_len(wrd) as int));
}
fn huge_word(printer p, str wrd) { p.pretty_print(STRING(wrd, 0xffff)); }
fn huge_word(printer p, str wrd) {
p.pretty_print(STRING(wrd, size_infinity));
}
fn zero_word(printer p, str wrd) { p.pretty_print(STRING(wrd, 0)); }
@ -512,10 +514,10 @@ fn zerobreak(printer p) { spaces(p, 0u); }
fn space(printer p) { spaces(p, 1u); }
fn hardbreak(printer p) { spaces(p, 0xffffu); }
fn hardbreak(printer p) { spaces(p, size_infinity as uint); }
fn hardbreak_tok() -> token {
ret BREAK(rec(offset=0, blank_space=0xffff));
ret BREAK(rec(offset=0, blank_space=size_infinity));
}
//

View File

@ -183,8 +183,8 @@ fn print_mod(&ps s, ast::_mod _mod) {
}
for (@ast::item item in _mod.items) {
// Mod-level item printing we're a little more space-y about.
hardbreak_if_not_bol(s);
hardbreak(s.s);
hardbreak(s.s);
print_item(s, item);
}
print_remaining_comments(s);