summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-07-07 18:54:34 +0000
committerGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-07-07 18:54:34 +0000
commit82fa132d6bf74589a925b1b4ae75113180dbd22a (patch)
treee4e80acec6e1e0562b39c26579ba9cd333f17347 /src
parentd9f65f3eb35c6d320008435e01009eb75c681b9c (diff)
downloadscala-82fa132d6bf74589a925b1b4ae75113180dbd22a.tar.gz
scala-82fa132d6bf74589a925b1b4ae75113180dbd22a.tar.bz2
scala-82fa132d6bf74589a925b1b4ae75113180dbd22a.zip
Patch so that .scala can be be ommited when loa...
Patch so that .scala can be be ommited when loading a file.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/InterpreterLoop.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
index 3f5e4d5c41..af4b2052be 100644
--- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala
+++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
@@ -197,7 +197,8 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) {
out.println("That command requires a filename to be specified.")
return ()
}
- val filename = command.substring(spaceIdx).trim
+ val name = command.substring(spaceIdx).trim
+ val filename = if(name.toLowerCase endsWith ".scala") name else (name + ".scala")
if (! new File(filename).exists) {
out.println("That file does not exist")
return ()