summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/DocComments.scala
diff options
context:
space:
mode:
authorMasato Sogame <poketo7878@gmail.com>2014-07-14 20:20:51 +0900
committerpoketo7878 <poketo7878@gmail.com>2014-07-15 22:49:25 +0900
commit68b16a0992877b4ebbb7c967804edbb72c05ceb5 (patch)
tree5569f479109099bdbdf5643fdde649db0a3cf757 /src/compiler/scala/tools/nsc/ast/DocComments.scala
parent462fe6a7189dbfef7b2cf888f9716a80880c0d9f (diff)
downloadscala-68b16a0992877b4ebbb7c967804edbb72c05ceb5.tar.gz
scala-68b16a0992877b4ebbb7c967804edbb72c05ceb5.tar.bz2
scala-68b16a0992877b4ebbb7c967804edbb72c05ceb5.zip
Update javadoc tag to new scaladoc tags.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/DocComments.scala')
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/DocComments.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala
index 6d9b41ec45..02a199f7ac 100755
--- a/src/compiler/scala/tools/nsc/ast/DocComments.scala
+++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala
@@ -59,14 +59,21 @@ trait DocComments { self: Global =>
comment.defineVariables(sym)
}
+
+ def replaceInheritDocToInheritdoc(docStr: String):String = {
+ docStr.replaceAll("""\{@inheritDoc\p{Zs}*\}""", "@inheritdoc")
+ }
+
/** The raw doc comment of symbol `sym`, minus usecase and define sections, augmented by
* missing sections of an inherited doc comment.
* If a symbol does not have a doc comment but some overridden version of it does,
* the doc comment of the overridden version is copied instead.
*/
def cookedDocComment(sym: Symbol, docStr: String = ""): String = cookedDocComments.getOrElseUpdate(sym, {
- val ownComment = if (docStr.length == 0) docComments get sym map (_.template) getOrElse ""
+ var ownComment = if (docStr.length == 0) docComments get sym map (_.template) getOrElse ""
else DocComment(docStr).template
+ ownComment = replaceInheritDocToInheritdoc(ownComment)
+
superComment(sym) match {
case None =>
if (ownComment.indexOf("@inheritdoc") != -1)