diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-23 09:03:56 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-23 09:03:56 -0700 |
commit | 114d7087c45125d523055481d410f156febf3015 (patch) | |
tree | faff3f10df74e7893e224d4bb7c95d33f875d2dc | |
parent | ed45b711e6a05635630bd8967a3a59dae4fde95e (diff) | |
parent | df292901c3dd9688d1dabf4ebaa9d73a23ebfe80 (diff) | |
download | scala-114d7087c45125d523055481d410f156febf3015.tar.gz scala-114d7087c45125d523055481d410f156febf3015.tar.bz2 scala-114d7087c45125d523055481d410f156febf3015.zip |
Merge pull request #2279 from kzys/jira-7013
SI-7013 Scaladoc: Fix StackOverflowError
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala b/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala index ee78f4ea7a..6fdaaed75f 100644 --- a/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala +++ b/src/compiler/scala/tools/nsc/doc/html/SyntaxHigh.scala @@ -6,6 +6,7 @@ package scala.tools.nsc.doc.html import scala.xml.NodeSeq +import scala.annotation.tailrec /** Highlight the syntax of Scala code appearing in a `{{{` wiki block * (see method `HtmlPage.blockToHtml`). @@ -209,9 +210,9 @@ private[html] object SyntaxHigh { out.toString } - def parse(pre: String, i: Int): Int = { + @tailrec def parse(pre: String, i: Int): Unit = { out append pre - if (i == buf.length) return i + if (i == buf.length) return buf(i) match { case '\n' => parse("\n", i+1) @@ -277,7 +278,6 @@ private[html] object SyntaxHigh { } else parse(buf(i).toChar.toString, i+1) } - i } parse("", 0) |