diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2011-11-07 20:16:25 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2011-11-07 20:16:25 -0800 |
commit | 63da22c025e85e9652bdc22de8d63f9af9d38cae (patch) | |
tree | dc6f0f4482d772ff00906317cd64d55941185e71 | |
parent | 3fad5e580f6ca8a7ade6d566f7cc51f975c60e93 (diff) | |
download | spark-63da22c025e85e9652bdc22de8d63f9af9d38cae.tar.gz spark-63da22c025e85e9652bdc22de8d63f9af9d38cae.tar.bz2 spark-63da22c025e85e9652bdc22de8d63f9af9d38cae.zip |
Update REPL code to use our own version of JLineReader, which fixes #89.
I'm not entirely sure why this broke in the jump from Scala 2.9.0.1 to
2.9.1 -- maybe something about name resolution changed?
-rw-r--r-- | repl/src/main/scala/spark/repl/SparkILoop.scala | 8 | ||||
-rw-r--r-- | repl/src/main/scala/spark/repl/SparkJLineCompletion.scala | 2 | ||||
-rw-r--r-- | repl/src/main/scala/spark/repl/SparkJLineReader.scala | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/repl/src/main/scala/spark/repl/SparkILoop.scala b/repl/src/main/scala/spark/repl/SparkILoop.scala index 490efa69bc..a4bca02d21 100644 --- a/repl/src/main/scala/spark/repl/SparkILoop.scala +++ b/repl/src/main/scala/spark/repl/SparkILoop.scala @@ -802,13 +802,13 @@ class SparkILoop(in0: Option[BufferedReader], val out: PrintWriter, val master: def chooseReader(settings: Settings): InteractiveReader = { if (settings.Xnojline.value || Properties.isEmacsShell) SimpleReader() - else try JLineReader( + else try SparkJLineReader( if (settings.noCompletion.value) NoCompletion - else new JLineCompletion(intp) + else new SparkJLineCompletion(intp) ) catch { case ex @ (_: Exception | _: NoClassDefFoundError) => - echo("Failed to created JLineReader: " + ex + "\nFalling back to SimpleReader.") + echo("Failed to created SparkJLineReader: " + ex + "\nFalling back to SimpleReader.") SimpleReader() } } @@ -985,7 +985,7 @@ object SparkILoop { repl.settings = new Settings(echo) repl.settings.embeddedDefaults[T] repl.createInterpreter() - repl.in = JLineReader(repl) + repl.in = SparkJLineReader(repl) // rebind exit so people don't accidentally call sys.exit by way of predef repl.quietRun("""def exit = println("Type :quit to resume program execution.")""") diff --git a/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala b/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala index 5d12898732..0069d8b2f4 100644 --- a/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala +++ b/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala @@ -15,7 +15,7 @@ import collection.mutable.ListBuffer // REPL completor - queries supplied interpreter for valid // completions based on current contents of buffer. -class JLineCompletion(val intp: SparkIMain) extends Completion with CompletionOutput { +class SparkJLineCompletion(val intp: SparkIMain) extends Completion with CompletionOutput { val global: intp.global.type = intp.global import global._ import definitions.{ PredefModule, RootClass, AnyClass, AnyRefClass, ScalaPackage, JavaLangPackage } diff --git a/repl/src/main/scala/spark/repl/SparkJLineReader.scala b/repl/src/main/scala/spark/repl/SparkJLineReader.scala index f7b0261ad0..ef6b6e092e 100644 --- a/repl/src/main/scala/spark/repl/SparkJLineReader.scala +++ b/repl/src/main/scala/spark/repl/SparkJLineReader.scala @@ -73,7 +73,7 @@ class SparkJLineReader(val completion: Completion) extends InteractiveReader { def readOneKey(prompt: String) = consoleReader readOneKey prompt } -object JLineReader { - def apply(intp: SparkIMain): JLineReader = apply(new JLineCompletion(intp)) - def apply(comp: Completion): JLineReader = new JLineReader(comp) +object SparkJLineReader { + def apply(intp: SparkIMain): SparkJLineReader = apply(new SparkJLineCompletion(intp)) + def apply(comp: Completion): SparkJLineReader = new SparkJLineReader(comp) } |