diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-06-08 17:56:41 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-06-09 11:38:40 +0200 |
commit | df8490167708d009157710e5ad73fa6f8ed3f6fc (patch) | |
tree | 5802d1c62e678d90be7ea5f575c8793563ef9ab7 /src/dotty/tools/dotc/repl/REPL.scala | |
parent | a00a972c7425232432364bf991e118d248578f0d (diff) | |
download | dotty-df8490167708d009157710e5ad73fa6f8ed3f6fc.tar.gz dotty-df8490167708d009157710e5ad73fa6f8ed3f6fc.tar.bz2 dotty-df8490167708d009157710e5ad73fa6f8ed3f6fc.zip |
Add loader support for dotty bridge
Diffstat (limited to 'src/dotty/tools/dotc/repl/REPL.scala')
-rw-r--r-- | src/dotty/tools/dotc/repl/REPL.scala | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/repl/REPL.scala b/src/dotty/tools/dotc/repl/REPL.scala index 1fcb055d6..cca5e8d6b 100644 --- a/src/dotty/tools/dotc/repl/REPL.scala +++ b/src/dotty/tools/dotc/repl/REPL.scala @@ -4,7 +4,10 @@ package repl import core.Contexts.Context import reporting.Reporter -import java.io.{BufferedReader, File, FileReader, PrintWriter} +import io.{AbstractFile, PlainFile, VirtualDirectory} +import scala.reflect.io.{PlainDirectory, Directory} +import java.io.{BufferedReader, File => JFile, FileReader, PrintWriter} +import java.net.{URL, URLClassLoader} /** A compiler which stays resident between runs. * Usage: @@ -31,7 +34,7 @@ class REPL extends Driver { } override def newCompiler(implicit ctx: Context): Compiler = - new repl.CompilingInterpreter(config.output, ctx) + new repl.CompilingInterpreter(config.output, ctx, config.classLoader) override def sourcesRequired = false @@ -80,6 +83,9 @@ object REPL { */ val boundValues: Array[(String, Any)] = Array.empty[(String, Any)] + /** To pass a custom ClassLoader to the Dotty REPL, overwride this value */ + val classLoader: Option[ClassLoader] = None + /** The default input reader */ def input(in: Interpreter)(implicit ctx: Context): InteractiveReader = { val emacsShell = System.getProperty("env.emacs", "") != "" |