diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-08-27 00:30:07 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-10-06 17:45:12 +0200 |
commit | 5463b7a9d42ece31409526ce192d263f7f55e047 (patch) | |
tree | bbdacab4ef724e42a45f3e59c0fa8acdf3ba3b3e /src/dotty/tools/dotc/core/Comments.scala | |
parent | ea24c55fdc7b3310a7f9911b408647701b5799fa (diff) | |
download | dotty-5463b7a9d42ece31409526ce192d263f7f55e047.tar.gz dotty-5463b7a9d42ece31409526ce192d263f7f55e047.tar.bz2 dotty-5463b7a9d42ece31409526ce192d263f7f55e047.zip |
Fix cooking of docstrings
Diffstat (limited to 'src/dotty/tools/dotc/core/Comments.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Comments.scala | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Comments.scala b/src/dotty/tools/dotc/core/Comments.scala index 1d9d53bac..ea5726fa0 100644 --- a/src/dotty/tools/dotc/core/Comments.scala +++ b/src/dotty/tools/dotc/core/Comments.scala @@ -15,6 +15,7 @@ import dotty.tools.dottydoc.model.comment.CommentUtils._ object Comments { case class Comment(pos: Position, raw: String)(implicit ctx: Context) { + val isDocComment = raw.startsWith("/**") private[this] lazy val sections = tagIndex(raw) @@ -41,10 +42,10 @@ object Comments { val code = raw.substring(codeStart, codeEnd) + " = ???" val codePos = subPos(codeStart, codeEnd) val commentStart = skipLineLead(raw, codeEnd + 1) min end - val comment = "/** " + raw.substring(commentStart, end) + "*/" + val commentStr = "/** " + raw.substring(commentStart, end) + "*/" val commentPos = subPos(commentStart, end) - UseCase(Comment(commentPos, comment), code, codePos) + UseCase(Comment(commentPos, commentStr), code, codePos) } private def subPos(start: Int, end: Int) = @@ -57,9 +58,6 @@ object Comments { } case class UseCase(comment: Comment, code: String, codePos: Position)(implicit ctx: Context) { - /** Entered by Namer */ - var symbol: Symbol = _ - /** Set by typer */ var tpdCode: tpd.DefDef = _ @@ -68,7 +66,7 @@ object Comments { tree match { case tree: untpd.DefDef => - val newName = (tree.name.show + "$" + codePos.start).toTermName + val newName = (tree.name.show + "$" + codePos + "$doc").toTermName untpd.DefDef(newName, tree.tparams, tree.vparamss, tree.tpt, tree.rhs) case _ => ctx.error("proper definition was not found in `@usecase`", codePos) |