From 6356e8ef0cb7ae10e8042e0927b0ba26acb600d5 Mon Sep 17 00:00:00 2001 From: Kato Kazuyoshi Date: Thu, 26 Mar 2015 07:10:25 -0700 Subject: Don't define the wiki syntax in multiple places DocComments#expandWiki() had been used by DocComments#toJavaDoc before, but the latter was removed by #3004. Based on GitHub (yeah, it's wild guess), we don't have any external cosumers other than that. https://github.com/search?l=scala&q=expandWiki+-filename%3ADocComments&ref=searchresults&type=Code&utf8=%E2%9C%93 --- src/compiler/scala/tools/nsc/ast/DocComments.scala | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala index 02a199f7ac..055f658670 100755 --- a/src/compiler/scala/tools/nsc/ast/DocComments.scala +++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala @@ -129,25 +129,6 @@ trait DocComments { self: Global => getDocComment(sym) map getUseCases getOrElse List() } - private val wikiReplacements = List( - ("""(\n\s*\*?)(\s*\n)""" .r, """$1

$2"""), - ("""<([^\w/])""" .r, """<$1"""), - ("""([^\w/])>""" .r, """$1>"""), - ("""\{\{\{(.*(?:\n.*)*)\}\}\}""".r, """

$1
"""), - ("""`([^`]*)`""" .r, """$1"""), - ("""__([^_]*)__""" .r, """$1"""), - ("""''([^']*)''""" .r, """$1"""), - ("""'''([^']*)'''""" .r, """$1"""), - ("""\^([^^]*)\^""" .r, """$1"""), - (""",,([^,]*),,""" .r, """$1""")) - - /** Returns just the wiki expansion (this would correspond to - * a comment in the input format of the JavaDoc tool, modulo differences - * in tags.) - */ - def expandWiki(str: String): String = - (str /: wikiReplacements) { (str1, regexRepl) => regexRepl._1 replaceAllIn(str1, regexRepl._2) } - private def getDocComment(sym: Symbol): Option[DocComment] = mapFind(sym :: allInheritedOverriddenSymbols(sym))(docComments get _) -- cgit v1.2.3