diff options
author | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-04-12 14:48:39 +0000 |
---|---|---|
committer | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2011-04-12 14:48:39 +0000 |
commit | ca05143ea7c07e0e84e8fd66259df27392213861 (patch) | |
tree | 13b730f1c23afcf1145451ec8cec0ab6b7942a2c /src/compiler | |
parent | b6ab8af4f23be72a84e5daea153b8363116408b0 (diff) | |
download | scala-ca05143ea7c07e0e84e8fd66259df27392213861.tar.gz scala-ca05143ea7c07e0e84e8fd66259df27392213861.tar.bz2 scala-ca05143ea7c07e0e84e8fd66259df27392213861.zip |
[scaladoc] Closes #4452 again. Review by malayeri.
Diffstat (limited to 'src/compiler')
-rwxr-xr-x | src/compiler/scala/tools/nsc/ast/DocComments.scala | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala index 1a807cc2c3..9df0069ada 100755 --- a/src/compiler/scala/tools/nsc/ast/DocComments.scala +++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala @@ -304,11 +304,7 @@ trait DocComments { self: SymbolTable => val end = startTag(raw, (defines ::: usecases).sort(_._1 < _._1)) (if (end == raw.length - 2) raw else raw.substring(0, end) + "*/", - defines map { - case (start, end) => raw.substring(start, end) - } map { - _.replaceAll("(?m)^\\s+\\*", "") - }, + defines map { case (start, end) => raw.substring(start, end) }, usecases map { case (start, end) => decomposeUseCase(start, end) }) } @@ -332,13 +328,18 @@ trait DocComments { self: SymbolTable => pos withStart start1 withPoint start1 withEnd end1 } - def defineVariables(sym: Symbol) { - for (str <- defines) { - val start = skipWhitespace(str, "@define".length) - var idx = skipVariable(str, start) - val vble = variableName(str.substring(start, idx)) + def defineVariables(sym: Symbol) = { + val Trim = "(?s)^[\\s&&[^\n\r]]*(.*?)\\s*$".r - defs(sym) += vble -> (str drop idx).trim.replaceAll("""\s+\*+$""", "") + defs(sym) ++= defines.map { + str => { + val start = skipWhitespace(str, "@define".length) + val (key, value) = str.splitAt(skipVariable(str, start)) + key.drop(start) -> value + } + } map { + case (key, Trim(value)) => + variableName(key) -> value.replaceAll("\\s+\\*+$", "") } } } |