diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-23 10:00:28 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-06-23 10:00:28 +0200 |
commit | 1c0b48da8dfa124eb762620c8cb803a9079b7c81 (patch) | |
tree | 6b4c161d8fdc70d301cb3d823b9e12f2a50aed2c /src | |
parent | b664a488acca9d89c600f5b87ba9a9ca77aace59 (diff) | |
parent | 2238a85d732dbfd63cfd9910511aa140838933f7 (diff) | |
download | scala-1c0b48da8dfa124eb762620c8cb803a9079b7c81.tar.gz scala-1c0b48da8dfa124eb762620c8cb803a9079b7c81.tar.bz2 scala-1c0b48da8dfa124eb762620c8cb803a9079b7c81.zip |
Merge pull request #3824 from retronym/ticket/8672
SI-8672 Better end-of-sentence detection for Scaladoc
Diffstat (limited to 'src')
-rwxr-xr-x | src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala b/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala index a933c35c99..19cc27b40b 100755 --- a/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala +++ b/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala @@ -666,7 +666,7 @@ trait CommentFactoryBase { this: MemberLookupBase => } def summary(): Inline = { - val i = inline(check(".")) + val i = inline(checkSentenceEnded()) Summary( if (jump(".")) Chain(List(i, Text("."))) @@ -785,6 +785,16 @@ trait CommentFactoryBase { this: MemberLookupBase => }) } + def checkSentenceEnded(): Boolean = { + (char == '.') && { + val poff = offset + nextChar() // read '.' + val ok = char == endOfText || char == endOfLine || isWhitespace(char) + offset = poff + ok + } + } + def reportError(pos: Position, message: String) { reporter.warning(pos, message) } |