From 0235e742f6487ca235b22047c013e341077a45be Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 31 May 2011 17:35:47 -0700 Subject: [PATCH] Give up on use of huge_word for comments. Still not formatting quite right, but closer. --- src/comp/pretty/pprust.rs | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/comp/pretty/pprust.rs b/src/comp/pretty/pprust.rs index ca6e83fc8487..8e0d70e27fe9 100644 --- a/src/comp/pretty/pprust.rs +++ b/src/comp/pretty/pprust.rs @@ -1185,32 +1185,25 @@ fn print_remaining_comments(&ps s) { fn print_comment(&ps s, lexer::cmnt cmnt) { alt (cmnt.style) { - case (lexer::isolated) { - hardbreak(s.s); - for (str line in cmnt.lines) { - huge_word(s.s, line); - zerobreak(s.s); - } - } - case (lexer::trailing) { - if (vec::len(cmnt.lines) == 1u) { - word(s.s, cmnt.lines.(0)); - hardbreak(s.s); - } else { - cbox(s.s, 0u); - for (str line in cmnt.lines) { - huge_word(s.s, line); - zerobreak(s.s); - } - end(s.s); - } - } case (lexer::mixed) { assert vec::len(cmnt.lines) == 1u; zerobreak(s.s); word(s.s, cmnt.lines.(0)); zerobreak(s.s); } + case (_) { + if (vec::len(cmnt.lines) == 1u) { + word(s.s, cmnt.lines.(0)); + hardbreak(s.s); + } else { + ibox(s.s, 0u); + for (str line in cmnt.lines) { + word(s.s, line); + hardbreak(s.s); + } + end(s.s); + } + } } } //