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
committerAntoine Gourlay <antoine@gourlay.fr>2014-08-11 17:56:12 +0200
commit40beefbb750d326a5ae71ed852c58dc9a31d7e17 (patch)
treeba2fd2d827185a24fa0e4ac347d560ce88dcf6ee /src/compiler/scala/tools/nsc/ast/DocComments.scala
parent5cb672bdc6e8a662ddc68a07811956e78a134acf (diff)
downloadscala-40beefbb750d326a5ae71ed852c58dc9a31d7e17.tar.gz
scala-40beefbb750d326a5ae71ed852c58dc9a31d7e17.tar.bz2
scala-40beefbb750d326a5ae71ed852c58dc9a31d7e17.zip
[backport] Update javadoc tag to new scaladoc tags.
(cherry picked from commit 68b16a0992877b4ebbb7c967804edbb72c05ceb5)
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)