summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-06-12 14:36:37 +0000
committerLex Spoon <lex@lexspoon.org>2007-06-12 14:36:37 +0000
commit5740c65d5f263ac67fa06c37bf18fec0fcf08a2e (patch)
tree61a866c1e293d11b7f0ea20628ecb7eec624faf9
parent84bed4cf438dc969089a057a4791d8bf9f3efa40 (diff)
downloadscala-5740c65d5f263ac67fa06c37bf18fec0fcf08a2e.tar.gz
scala-5740c65d5f263ac67fa06c37bf18fec0fcf08a2e.tar.bz2
scala-5740c65d5f263ac67fa06c37bf18fec0fcf08a2e.zip
factored out the creation of the compiler, so that
a subclass can override the concrete compiler class to be used
-rw-r--r--src/compiler/scala/tools/nsc/Interpreter.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala
index 479911b92b..c986c86664 100644
--- a/src/compiler/scala/tools/nsc/Interpreter.scala
+++ b/src/compiler/scala/tools/nsc/Interpreter.scala
@@ -102,8 +102,13 @@ class Interpreter(val settings: Settings, out: PrintWriter) {
override def printMessage(msg: String) = out.println(clean(msg))
}
+ /** Instantiate a compiler. Subclasses can override this to
+ * change the compiler class used by this interpreter. */
+ protected def newCompiler(settings: Settings, reporter: Reporter)
+ = new Global(settings, reporter)
+
/** the compiler to compile expressions with */
- val compiler: Global = new Global(settings, reporter)
+ val compiler: Global = newCompiler(settings, reporter)
/** the compiler's classpath, as URL's */
val compilerClasspath: List[URL] =