diff options
author | michelou <michelou@epfl.ch> | 2007-05-21 08:32:16 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2007-05-21 08:32:16 +0000 |
commit | ef2279df3d7f3cb4b120e323bc67cac8f60f3e57 (patch) | |
tree | 9c6cdfc4d72427bafc4c4f10e2a8b7bb2e31cb21 /src/library/scala/text | |
parent | 77863427aeaae8c34ae95595eafa5bf0a2d8e69a (diff) | |
download | scala-ef2279df3d7f3cb4b120e323bc67cac8f60f3e57.tar.gz scala-ef2279df3d7f3cb4b120e323bc67cac8f60f3e57.tar.bz2 scala-ef2279df3d7f3cb4b120e323bc67cac8f60f3e57.zip |
minor changes
Diffstat (limited to 'src/library/scala/text')
-rw-r--r-- | src/library/scala/text/Document.scala | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/library/scala/text/Document.scala b/src/library/scala/text/Document.scala index 336ad30cc2..0808714c9d 100644 --- a/src/library/scala/text/Document.scala +++ b/src/library/scala/text/Document.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -36,14 +36,14 @@ abstract class Document { def :/:(hd: String): Document = hd :: DocBreak :: this /** - * Format this document on WRITER and try to set line breaks so that - * the result fits in WIDTH columns. + * Format this document on <code>writer</code> and try to set line + * breaks so that the result fits in <code>width</code> columns. * * @param width ... * @param writer ... */ - def format(width: Int, writer: Writer): Unit = { - type FmtState = (Int,Boolean,Document) + def format(width: Int, writer: Writer) { + type FmtState = (Int, Boolean, Document) def fits(w: Int, state: List[FmtState]): boolean = state match { case _ if w < 0 => @@ -66,12 +66,12 @@ abstract class Document { fits(w, (i, false, d) :: z) } - def spaces(n: Int): Unit = { + def spaces(n: Int) { var rem = n - while (rem >= 16) { writer write " "; rem = rem - 16 } - if (rem >= 8) { writer write " "; rem = rem - 8 } - if (rem >= 4) { writer write " "; rem = rem - 4 } - if (rem >= 2) { writer write " "; rem = rem - 2} + while (rem >= 16) { writer write " "; rem -= 16 } + if (rem >= 8) { writer write " "; rem -= 8 } + if (rem >= 4) { writer write " "; rem -= 4 } + if (rem >= 2) { writer write " "; rem -= 2} if (rem == 1) { writer write " " } } |