From b4622aabd0ebd6929639c9cfcd3c7845a250598f Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 5 May 2016 09:33:43 +0200 Subject: Fix root-package finding in comment-parser --- .../jvm/src/dotty/tools/dottydoc/model/CommentParsers.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/model/CommentParsers.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/model/CommentParsers.scala index bd9eb87f9..9320bb5fe 100644 --- a/dottydoc/jvm/src/dotty/tools/dottydoc/model/CommentParsers.scala +++ b/dottydoc/jvm/src/dotty/tools/dottydoc/model/CommentParsers.scala @@ -58,11 +58,14 @@ object CommentParsers { var packages: List[String] = Nil for (key <- packs.keys) { - val keyDepth = key.split(".").length + val keyDepth = key.split("\\.").length packages = - if (keyDepth < currentDepth) key :: Nil - else if (keyDepth == currentDepth) key :: packages - else packages + if (keyDepth < currentDepth) { + currentDepth = keyDepth + key :: Nil + } else if (keyDepth == currentDepth) { + key :: packages + } else packages } packages -- cgit v1.2.3