summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2006-03-15 17:00:52 +0000
committerLex Spoon <lex@lexspoon.org>2006-03-15 17:00:52 +0000
commit2b54dff2c28f8dfd200fb52af2ce96090e2f18e9 (patch)
tree9c13668c195380d72fbff0b0db6bbf2975bd7b06 /src
parentbbfac7615b74c39e944f3216f620d8f8b8e45272 (diff)
downloadscala-2b54dff2c28f8dfd200fb52af2ce96090e2f18e9.tar.gz
scala-2b54dff2c28f8dfd200fb52af2ce96090e2f18e9.tar.bz2
scala-2b54dff2c28f8dfd200fb52af2ce96090e2f18e9.zip
Add the compiler's classpath to the Interpreter...
Add the compiler's classpath to the Interpreter's *run* classpath
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Interpreter.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala
index 45c2eb24bb..3eae5d9c23 100644
--- a/src/compiler/scala/tools/nsc/Interpreter.scala
+++ b/src/compiler/scala/tools/nsc/Interpreter.scala
@@ -94,8 +94,12 @@ class Interpreter(val compiler: Global, output: (String => Unit)) {
else
new java.net.URLClassLoader(Predef.Array(classfilePath.toURL), parentClassLoader)
}
- protected def parentClassLoader : ClassLoader = null;
-
+ protected def parentClassLoader : ClassLoader = {
+ new java.net.URLClassLoader(
+ compiler.settings.classpath.value.split(File.pathSeparator).
+ map(s => new File(s).toURL),
+ ClassLoader.getSystemClassLoader)
+ }
/** the previous requests this interpreter has processed */
private val prevRequests = new ArrayBuffer[Request]()
@@ -205,7 +209,7 @@ class Interpreter(val compiler: Global, output: (String => Unit)) {
strings. */
def interpret(line: String): Unit = {
// parse
- val trees = parse(line)
+ val trees = parse(line)
if(trees.isEmpty) return () // parse error or empty input
val lineName = newLineName