diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-06-20 17:07:29 +0000 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-06-20 19:58:23 +0000 |
| commit | c0515017842a4b7872ff31bd91acec4a54d2ef2d (patch) | |
| tree | 6caf1efc0109aad244d4ab18f6bdc5a930000423 | |
| parent | 8cd0695230fa234306084186f7c96435e7f61495 (diff) | |
| download | rust-c0515017842a4b7872ff31bd91acec4a54d2ef2d.tar.gz rust-c0515017842a4b7872ff31bd91acec4a54d2ef2d.zip | |
Tighten up the hardbreak rules a bit.
| -rw-r--r-- | src/comp/pretty/pp.rs | 8 | ||||
| -rw-r--r-- | src/comp/pretty/pprust.rs | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/comp/pretty/pp.rs b/src/comp/pretty/pp.rs index 3ae3eafa5b0..ef3a87585c4 100644 --- a/src/comp/pretty/pp.rs +++ b/src/comp/pretty/pp.rs @@ -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)); } // diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs index cf32d5535f1..d47ab331f77 100644 --- a/src/comp/pretty/pprust.rs +++ b/src/comp/pretty/pprust.rs @@ -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); |
