From a4d47adf0e2ba9e12537c6f433d823dddecf25ab Mon Sep 17 00:00:00 2001 From: Sean McDirmid Date: Tue, 24 Jun 2008 10:01:16 +0000 Subject: convering vals to lazy vals to accomodate new i... convering vals to lazy vals to accomodate new initialization semantics. --- .../scala/tools/nsc/doc/DefaultDocDriver.scala | 14 +++++++------- src/compiler/scala/tools/nsc/doc/DocUtil.scala | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/compiler/scala/tools/nsc/doc/DefaultDocDriver.scala b/src/compiler/scala/tools/nsc/doc/DefaultDocDriver.scala index 32ab8d64cd..c4443713cf 100644 --- a/src/compiler/scala/tools/nsc/doc/DefaultDocDriver.scala +++ b/src/compiler/scala/tools/nsc/doc/DefaultDocDriver.scala @@ -19,8 +19,8 @@ abstract class DefaultDocDriver extends DocDriver with ModelFrames with ModelToX import global._ import definitions.{AnyClass, AnyRefClass} - val additions = new jcl.LinkedHashSet[Symbol] - val additions0 = new ModelAdditions(global) { + lazy val additions = new jcl.LinkedHashSet[Symbol] + lazy val additions0 = new ModelAdditions(global) { override def addition(sym: global.Symbol) = { super.addition(sym) sym match { @@ -109,7 +109,7 @@ abstract class DefaultDocDriver extends DocDriver with ModelFrames with ModelToX for (pp <- d.sym.tpe.parents) subClasses(pp.typeSymbol) += d } copyResources - val packages0 = sort(allClasses.keySet) + lazy val packages0 = sort(allClasses.keySet) new AllPackagesFrame with Frame { def packages = packages0 } new PackagesContentFrame with Frame { def packages = packages0 } new NavigationFrame with Frame { } @@ -178,12 +178,12 @@ abstract class DefaultDocDriver extends DocDriver with ModelFrames with ModelToX override def classBody(entity: ClassOrObject)(implicit from: Frame): NodeSeq = (subClasses.get(entity.sym) match { case Some(symbols) => -
+ (
Direct Known Subclasses:
{symbols.mkXML("",", ","")(cls => { aref(urlFor(cls.sym), cls.path.map(_.name).mkString("",".","")); })}
-

; +

); case None => NodeSeq.Empty })++super.classBody(entity); @@ -208,7 +208,7 @@ abstract class DefaultDocDriver extends DocDriver with ModelFrames with ModelToX val href = path + sym.fullNameString('/') + (if (sym.isModule || sym.isModuleClass) NAME_SUFFIX_OBJECT else "") + "#" + s - {option} ++ {Text(" - ")}; + ({option}) ++ {Text(" - ")}; case _ => super.decodeOption(tag,option) } @@ -258,7 +258,7 @@ abstract class DefaultDocDriver extends DocDriver with ModelFrames with ModelToX frame.aref(href, "_self", label) protected def anchor(entity: Symbol)(implicit frame: Frame): NodeSeq = - + () object symbols extends jcl.LinkedHashSet[Symbol] diff --git a/src/compiler/scala/tools/nsc/doc/DocUtil.scala b/src/compiler/scala/tools/nsc/doc/DocUtil.scala index 93c83d8dfe..24622250f0 100644 --- a/src/compiler/scala/tools/nsc/doc/DocUtil.scala +++ b/src/compiler/scala/tools/nsc/doc/DocUtil.scala @@ -34,8 +34,8 @@ object DocUtil { // def label = "#PCDATA" //} - def br(nodes: NodeSeq): NodeSeq = nodes ++
- def hr(nodes: NodeSeq): NodeSeq = nodes ++
+ def br(nodes: NodeSeq): NodeSeq = nodes ++ (
) + def hr(nodes: NodeSeq): NodeSeq = nodes ++ (
) trait UrlContext { def relative: String @@ -51,35 +51,35 @@ object DocUtil { val t0 = Text(text) if (target ne null) - {t0}; + ({t0}); else - {t0}; + ({t0}); } val encoding = Properties.encodingString val generator = System.getProperty("doc.generator", "scaladoc (" + Properties.versionString + ")") val header = - - ; + ); def body0(hasBody: Boolean, nodes: NodeSeq): NodeSeq = - if (!hasBody) nodes else {nodes}; + if (!hasBody) nodes else ({nodes}); val dtype = "" def page(title: String, body: NodeSeq, hasBody: Boolean): NodeSeq = - - {Text(title)} + ( + {Text(if (title eq null) "null title" else title)} {header} {body0(hasBody, body)} - + ) } // UrlContext def div0(title: String): NodeSeq = -
{Text(title)}
; + (
{Text(title)}
); def merge[T](ts0: TreeSet[T], ts1: TreeSet[T]): TreeSet[T] = { var ts = ts0 -- cgit v1.2.3