From ed37907d4fe426ba804fee9d6c7c4062ae4cce5f Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 12 Nov 2013 14:18:52 -0800 Subject: Refactoring to prepare modularization of the compiler. Actual modularization is delayed until 2.12. The one big (one-line) change is to make the interactive compiler independent of scaladoc. We have one "integration test": `MemoryLeaksTest`. This commit adds a bunch of comments marked `TODO: modularize the compiler`, that should be uncommented when we're ready to continue the modularization effort. I decided to merge them commented out to avoid having to rebase xml patches. There's still some chance of bitrot, but I'm willing to take my chances. I previously refactored the build to make it easier to add jars in a coherent way, which hinges on the `init-project-prop` mechanism, so the relevant properties are already injected there. --- .../presentation/memory-leaks/MemoryLeaksTest.scala | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'test/files/presentation') diff --git a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala index 1ddeb6ac4a..f09c6f8e2c 100644 --- a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala +++ b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala @@ -3,6 +3,7 @@ import java.io.FileOutputStream import java.util.Calendar import scala.reflect.internal.util.BatchSourceFile +import scala.tools.nsc.interactive import scala.tools.nsc.interactive.tests._ import scala.tools.nsc.io._ import scala.tools.nsc.doc @@ -25,7 +26,21 @@ import scala.tools.nsc.doc object Test extends InteractiveTest { final val mega = 1024 * 1024 - override val withDocComments = true + import interactive.Global + trait InteractiveScaladocAnalyzer extends interactive.InteractiveAnalyzer with doc.ScaladocAnalyzer { + val global : Global + override def newTyper(context: Context) = new Typer(context) with InteractiveTyper with ScaladocTyper { + override def canAdaptConstantTypeToLiteral = false + } + } + + private class ScaladocEnabledGlobal extends Global(settings, compilerReporter) { + override lazy val analyzer = new { + val global: ScaladocEnabledGlobal.this.type = ScaladocEnabledGlobal.this + } with InteractiveScaladocAnalyzer + } + + override def createGlobal: Global = new ScaladocEnabledGlobal override def execute(): Unit = memoryConsumptionTest() -- cgit v1.2.3