diff options
author | Lex Spoon <lex@lexspoon.org> | 2007-07-13 19:22:08 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2007-07-13 19:22:08 +0000 |
commit | 72105be047b775ad0c3080cb31dd43e392b6ce2b (patch) | |
tree | 0c96b8b1d5946a782113789ee067739cf66b406c /src | |
parent | 7529035f6d21021dcf518a8b53729d1c5c6374f5 (diff) | |
download | scala-72105be047b775ad0c3080cb31dd43e392b6ce2b.tar.gz scala-72105be047b775ad0c3080cb31dd43e392b6ce2b.tar.bz2 scala-72105be047b775ad0c3080cb31dd43e392b6ce2b.zip |
- interpret() creates compiler.Run the first ti...
- interpret() creates compiler.Run the first time it is called
- setContextClassLoader() is now available
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 68210e1fa4..6e1507e9fd 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -136,6 +136,13 @@ class Interpreter(val settings: Settings, out: PrintWriter) { new URLClassLoader((classfilePath.toURL :: compilerClasspath).toArray, parentClassLoader) + /** Set the current Java "context" class loader to this + * interpreter's class loader */ + def setContextClassLoader() { + Thread.currentThread.setContextClassLoader(classLoader) + } + + /** XXX Let's get rid of this. I believe the Eclipse plugin is * the only user of it, so this should be doable. */ protected def parentClassLoader: ClassLoader = null @@ -422,6 +429,9 @@ class Interpreter(val settings: Settings, out: PrintWriter) { * @return ... */ def interpret(line: String): IR.Result = { + if (prevRequests.isEmpty) + new compiler.Run // initialize the compiler + // parse val trees = parse(line) match { case None => return IR.Incomplete |