summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-09-27 12:28:55 -0700
committerPaul Phillips <paulp@improving.org>2013-10-02 08:59:55 -0700
commitaced32d05c97651534f468bc9a475ea5f6ae75b8 (patch)
treefda8b628ae8501a8df945aeb7f558f259c857e62 /src/repl
parent45183d8d28ff082d9186018b707f9fecb466f14f (diff)
downloadscala-aced32d05c97651534f468bc9a475ea5f6ae75b8.tar.gz
scala-aced32d05c97651534f468bc9a475ea5f6ae75b8.tar.bz2
scala-aced32d05c97651534f468bc9a475ea5f6ae75b8.zip
Removing unused code.
Most of this was revealed via -Xlint with a flag which assumes closed world. I can't see how to check the assumes-closed-world code in without it being an ordeal. I'll leave it in a branch in case anyone wants to finish the long slog to the merge.
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ByteCode.scala32
-rw-r--r--src/repl/scala/tools/nsc/interpreter/Completion.scala2
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ExprTyper.scala1
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala1
-rw-r--r--src/repl/scala/tools/nsc/interpreter/IMain.scala10
-rw-r--r--src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala1
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ReplStrings.scala2
7 files changed, 2 insertions, 47 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/ByteCode.scala b/src/repl/scala/tools/nsc/interpreter/ByteCode.scala
deleted file mode 100644
index e1e3678837..0000000000
--- a/src/repl/scala/tools/nsc/interpreter/ByteCode.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-/* NSC -- new Scala compiler
- * Copyright 2005-2013 LAMP/EPFL
- * @author Paul Phillips
- */
-
-package scala.tools.nsc
-package interpreter
-
-import java.lang.reflect
-import util.ScalaClassLoader
-import ScalaClassLoader.appLoader
-import scala.reflect.NameTransformer._
-
-object ByteCode {
- /** Until I figure out why I can't get scalap onto the classpath such
- * that the compiler will bootstrap, we have to use reflection.
- */
- private lazy val DECODER: Option[AnyRef] =
- for (clazz <- appLoader.tryToLoadClass[AnyRef]("scala.tools.scalap.Decode$")) yield
- clazz.getField(MODULE_INSTANCE_NAME).get(null)
-
- private def decoderMethod(name: String, args: JClass*): Option[reflect.Method] = {
- for (decoder <- DECODER ; m <- Option(decoder.getClass.getMethod(name, args: _*))) yield m
- }
-
- private lazy val aliasMap = {
- for (module <- DECODER ; method <- decoderMethod("typeAliases", classOf[String])) yield
- method.invoke(module, _: String).asInstanceOf[Option[Map[String, String]]]
- }
-
- def aliasesForPackage(pkg: String) = aliasMap flatMap (_(pkg))
-}
diff --git a/src/repl/scala/tools/nsc/interpreter/Completion.scala b/src/repl/scala/tools/nsc/interpreter/Completion.scala
index 84a5cb49ae..9ad7f95fae 100644
--- a/src/repl/scala/tools/nsc/interpreter/Completion.scala
+++ b/src/repl/scala/tools/nsc/interpreter/Completion.scala
@@ -12,12 +12,10 @@ import Completion._
* reference to the jline classes.
*/
trait Completion {
- type ExecResult
def resetVerbosity(): Unit
def completer(): ScalaCompleter
}
object NoCompletion extends Completion {
- type ExecResult = Nothing
def resetVerbosity() = ()
def completer() = NullCompleter
}
diff --git a/src/repl/scala/tools/nsc/interpreter/ExprTyper.scala b/src/repl/scala/tools/nsc/interpreter/ExprTyper.scala
index bb5fe07fc9..8a6a405810 100644
--- a/src/repl/scala/tools/nsc/interpreter/ExprTyper.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ExprTyper.scala
@@ -13,7 +13,6 @@ trait ExprTyper {
import repl._
import global.{ reporter => _, Import => _, _ }
- import syntaxAnalyzer.UnitParser
import naming.freshInternalVarName
def symbolOfLine(code: String): Symbol = {
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index 984a752964..217414809e 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -23,7 +23,6 @@ import scala.collection.generic.Clearable
import scala.concurrent.{ ExecutionContext, Await, Future, future }
import ExecutionContext.Implicits._
import java.io.{ BufferedReader, FileReader }
-import scala.reflect.internal.util.StringOps._
/** The Scala interactive shell. It provides a read-eval-print loop
* around the Interpreter class.
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala
index 7e8999a099..e4a3416152 100644
--- a/src/repl/scala/tools/nsc/interpreter/IMain.scala
+++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala
@@ -861,15 +861,7 @@ class IMain(@BeanProperty val factory: ScriptEngineFactory, initialSettings: Set
def path = originalPath("$intp")
def envLines = {
if (!isReplPower) Nil // power mode only for now
- // $intp is not bound; punt, but include the line.
- else if (path == "$intp") List(
- "def $line = " + tquoted(originalLine),
- "def $trees = Nil"
- )
- else List(
- "def $line = " + tquoted(originalLine),
- "def $trees = Nil"
- )
+ else List("def %s = %s".format("$line", tquoted(originalLine)), "def %s = Nil".format("$trees"))
}
val preamble = """
diff --git a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
index 61db8d1748..1b3d60d41a 100644
--- a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
+++ b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
@@ -17,7 +17,6 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
import global._
import definitions._
import rootMirror.{ RootClass, getModuleIfDefined }
- type ExecResult = Any
import intp.{ debugging }
// verbosity goes up with consecutive tabs
diff --git a/src/repl/scala/tools/nsc/interpreter/ReplStrings.scala b/src/repl/scala/tools/nsc/interpreter/ReplStrings.scala
index 08472bbc64..43da5c6f12 100644
--- a/src/repl/scala/tools/nsc/interpreter/ReplStrings.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ReplStrings.scala
@@ -28,5 +28,5 @@ trait ReplStrings {
def any2stringOf(x: Any, maxlen: Int) =
"scala.runtime.ScalaRunTime.replStringOf(%s, %s)".format(x, maxlen)
- def words(s: String) = s.trim split "\\s+" filterNot (_ == "") toList
+ def words(s: String) = (s.trim split "\\s+" filterNot (_ == "")).toList
}