summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-05 22:38:20 -0800
committerPaul Phillips <paulp@improving.org>2012-02-05 22:38:20 -0800
commit5be13bf0e0a2df0ddeda7652db0f54c0cba6c3bf (patch)
tree60e8b478d7f8eda0a407d1a4668de6a14ed22e83 /src
parent9d00ea8d389f4426f1f644e0a7f48e9ea380e9fc (diff)
downloadscala-5be13bf0e0a2df0ddeda7652db0f54c0cba6c3bf.tar.gz
scala-5be13bf0e0a2df0ddeda7652db0f54c0cba6c3bf.tar.bz2
scala-5be13bf0e0a2df0ddeda7652db0f54c0cba6c3bf.zip
Revert "Scaladoc @usecase annotation overriding / SI-5287"
This reverts commit 7946ac410ad74894cd0eb6dfd29447f173911b99.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/compiler/scala/tools/nsc/util/DocStrings.scala26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/compiler/scala/tools/nsc/util/DocStrings.scala b/src/compiler/scala/tools/nsc/util/DocStrings.scala
index 2c8b77be71..1db6c38b4d 100755
--- a/src/compiler/scala/tools/nsc/util/DocStrings.scala
+++ b/src/compiler/scala/tools/nsc/util/DocStrings.scala
@@ -71,35 +71,13 @@ object DocStrings {
* Every section starts with a `@` and extends to the next `@`, or
* to the end of the comment string, but excluding the final two
* characters which terminate the comment.
- *
- * Also take usecases into account - they need to expand until the next
- * @usecase or the end of the string, as they might include other sections
- * of their own
*/
def tagIndex(str: String, p: Int => Boolean = (idx => true)): List[(Int, Int)] =
findAll(str, 0) (idx => str(idx) == '@' && p(idx)) match {
case List() => List()
- case idxs => {
- val idxs2 = mergeUsecaseSections(str, idxs)
- idxs2 zip (idxs2.tail ::: List(str.length - 2))
- }
- }
-
- /**
- * Merge sections following an @usecase into the usecase comment, so they
- * can override the parent symbol's sections
- */
- def mergeUsecaseSections(str: String, idxs: List[Int]): List[Int] = {
- idxs.find(str.substring(_).startsWith("@usecase")) match {
- case Some(firstUC) =>
- val commentSections = idxs.take(idxs.indexOf(firstUC))
- val usecaseSections = idxs.drop(idxs.indexOf(firstUC)).filter(str.substring(_).startsWith("@usecase"))
- commentSections ::: usecaseSections
- case None =>
- idxs
+ case idxs => idxs zip (idxs.tail ::: List(str.length - 2))
}
- }
-
+
/** Does interval `iv` start with given `tag`?
*/
def startsWithTag(str: String, section: (Int, Int), tag: String): Boolean =