diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 7 |
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] = |