diff options
author | Masato Sogame <poketo7878@gmail.com> | 2014-07-14 20:20:51 +0900 |
---|---|---|
committer | Antoine Gourlay <antoine@gourlay.fr> | 2014-08-11 17:56:12 +0200 |
commit | 40beefbb750d326a5ae71ed852c58dc9a31d7e17 (patch) | |
tree | ba2fd2d827185a24fa0e4ac347d560ce88dcf6ee /src/compiler/scala/tools/nsc/ast/DocComments.scala | |
parent | 5cb672bdc6e8a662ddc68a07811956e78a134acf (diff) | |
download | scala-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-x | src/compiler/scala/tools/nsc/ast/DocComments.scala | 9 |
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) |