summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/session/History.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-04 03:43:22 +0000
committerPaul Phillips <paulp@improving.org>2011-02-04 03:43:22 +0000
commitf61020bb96c06f8da1f57e89703b233d01ec254c (patch)
tree24a726197a254046facd8bc3ac2319f8c5338f57 /src/compiler/scala/tools/nsc/interpreter/session/History.scala
parent985c587364aab272be69dfef72db2e24f4fd4385 (diff)
downloadscala-f61020bb96c06f8da1f57e89703b233d01ec254c.tar.gz
scala-f61020bb96c06f8da1f57e89703b233d01ec254c.tar.bz2
scala-f61020bb96c06f8da1f57e89703b233d01ec254c.zip
My repl history hasn't been working right for a...
My repl history hasn't been working right for a while (since about when jline2 was introduced.) Nobody else has said anything so either it's just me or I'm the only one using trunk, but either way I decided I'd rather write some history code than tinker with jline. So this is code to implement the jline history interface. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/session/History.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/session/History.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/session/History.scala b/src/compiler/scala/tools/nsc/interpreter/session/History.scala
new file mode 100644
index 0000000000..5e1aba20f1
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/interpreter/session/History.scala
@@ -0,0 +1,28 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.nsc
+package interpreter
+package session
+
+/** An implementation-agnostic history interface which makes no
+ * reference to the jline classes. Very sparse right now.
+ */
+trait History {
+ def asStrings: List[String]
+ def index: Int
+ def size: Int
+ def grep(s: String): List[String]
+}
+object NoHistory extends History {
+ def asStrings = Nil
+ def grep(s: String) = Nil
+ def index = 0
+ def size = 0
+}
+
+object History {
+ def empty: History = NoHistory
+}