summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-03-30 23:38:18 +0000
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-03-30 23:38:18 +0000
commite74515bbd35f53d772d6b4a0fe9d59e10bc82c89 (patch)
treeb267af2ebeda2fc856416c9bb361306dff06f18e /src
parent518cc3af73729574ba3364f53adf1ff66a356513 (diff)
downloadscala-e74515bbd35f53d772d6b4a0fe9d59e10bc82c89.tar.gz
scala-e74515bbd35f53d772d6b4a0fe9d59e10bc82c89.tar.bz2
scala-e74515bbd35f53d772d6b4a0fe9d59e10bc82c89.zip
[scaladoc] Scaladoc should expand macros recurs...
[scaladoc] Scaladoc should expand macros recursively. Closes #3484. Review by dubochet.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/DocComments.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala
index 9af43d406f..b0c7bd81cc 100755
--- a/src/compiler/scala/tools/nsc/ast/DocComments.scala
+++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala
@@ -213,14 +213,17 @@ trait DocComments { self: SymbolTable =>
* @param owner The current owner in which variable definitions are searched.
* @param site The class for which doc comments are generated
*/
- def lookupVariable(vble: String, site: Symbol): Option[String] =
+ def lookupVariable(vble: String, site: Symbol): Option[String] = {
+ val WITH_DOLLER = "^\\$(.*)$".r
if (site == NoSymbol)
None
else {
def lookInBaseClasses = mapFind(site.info.baseClasses)(defs(_).get(vble)) match {
case None => lookupVariable(vble, site.owner)
- case someStr => someStr
+ case Some(WITH_DOLLER(str)) => lookupVariable(str, site)
+ case Some(str) => Some(str)
}
+
if (site.isModule)
defs(site).get(vble) match {
case Some(str) => return Some(str)
@@ -228,6 +231,7 @@ trait DocComments { self: SymbolTable =>
}
else lookInBaseClasses
}
+ }
/** Expand variable occurrences in string `str', until a fix point is reached or
* a expandLimit is exceeded.
@@ -437,4 +441,4 @@ trait DocComments { self: SymbolTable =>
}
class ExpansionLimitExceeded(str: String) extends Exception
-} \ No newline at end of file
+}