diff options
author | Kazuyoshi Kato <kato.kazuyoshi@gmail.com> | 2016-06-24 08:17:35 -0700 |
---|---|---|
committer | Kazuyoshi Kato <kato.kazuyoshi@gmail.com> | 2016-07-27 06:54:27 -0700 |
commit | 8e55954654596c965f220154a5f557e49463fa81 (patch) | |
tree | bfb378355fda438709c35da75b4758d387b586ad /src | |
parent | 5ffce6e910f4cc1fced15824df86a9524be81681 (diff) | |
download | dotty-8e55954654596c965f220154a5f557e49463fa81.tar.gz dotty-8e55954654596c965f220154a5f557e49463fa81.tar.bz2 dotty-8e55954654596c965f220154a5f557e49463fa81.zip |
Fixes #1316: Remove JLine
Dotty uses ammonite.terminal since April (53bd25f) which replaces JLine.
There is no reason to keep it anymore.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/config/ScalaSettings.scala | 1 | ||||
-rw-r--r-- | src/dotty/tools/dotc/repl/InteractiveReader.scala | 13 | ||||
-rw-r--r-- | src/dotty/tools/dotc/repl/JLineReader.scala | 16 | ||||
-rw-r--r-- | src/dotty/tools/dotc/repl/Main.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/repl/REPL.scala | 2 |
5 files changed, 4 insertions, 31 deletions
diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala index 1c1c72671..d0c4cc02c 100644 --- a/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -74,7 +74,6 @@ class ScalaSettings extends Settings.SettingGroup { val maxClassfileName = IntSetting("-Xmax-classfile-name", "Maximum filename length for generated classes", 255, 72 to 255) val Xmigration = VersionSetting("-Xmigration", "Warn about constructs whose behavior may have changed since version.") val Xsource = VersionSetting("-Xsource", "Treat compiler input as Scala source for the specified version.") - val Xnojline = BooleanSetting("-Xnojline", "Do not use JLine for editing.") val Xverify = BooleanSetting("-Xverify", "Verify generic signatures in generated bytecode (asm backend only.)") val plugin = MultiStringSetting("-Xplugin", "file", "Load one or more plugins from files.") val disable = MultiStringSetting("-Xplugin-disable", "plugin", "Disable the given plugin(s).") diff --git a/src/dotty/tools/dotc/repl/InteractiveReader.scala b/src/dotty/tools/dotc/repl/InteractiveReader.scala index 6ec6a0463..07ce23717 100644 --- a/src/dotty/tools/dotc/repl/InteractiveReader.scala +++ b/src/dotty/tools/dotc/repl/InteractiveReader.scala @@ -13,17 +13,8 @@ trait InteractiveReader { /** The current Scala REPL know how to do this flexibly. */ object InteractiveReader { - /** Create an interactive reader. Uses JLine if the - * library is available, but otherwise uses a - * SimpleReader. */ + /** Create an interactive reader */ def createDefault(in: Interpreter)(implicit ctx: Context): InteractiveReader = { - try { - new AmmoniteReader(in) - } catch { case e => - //out.println("jline is not available: " + e) //debug - e.printStackTrace() - println("Could not use ammonite, falling back to simple reader") - new SimpleReader() - } + new AmmoniteReader(in) } } diff --git a/src/dotty/tools/dotc/repl/JLineReader.scala b/src/dotty/tools/dotc/repl/JLineReader.scala deleted file mode 100644 index 73463cd7c..000000000 --- a/src/dotty/tools/dotc/repl/JLineReader.scala +++ /dev/null @@ -1,16 +0,0 @@ -package dotty.tools -package dotc -package repl - -import dotc.core.Contexts.Context -import jline.console.ConsoleReader - -/** Adaptor for JLine - */ -class JLineReader extends InteractiveReader { - val reader = new ConsoleReader() - - val interactive = true - - def readLine(prompt: String) = reader.readLine(prompt) -} diff --git a/src/dotty/tools/dotc/repl/Main.scala b/src/dotty/tools/dotc/repl/Main.scala index b2b92299e..48ed3e788 100644 --- a/src/dotty/tools/dotc/repl/Main.scala +++ b/src/dotty/tools/dotc/repl/Main.scala @@ -13,7 +13,6 @@ package repl * * There are a number of TODOs: * - * - re-enable jline support (urgent, easy, see TODO in InteractiveReader.scala) * - figure out why we can launch REPL only with `java`, not with `scala`. * - make a doti command (urgent, easy) * - create or port REPL tests (urgent, intermediate) @@ -26,4 +25,4 @@ package repl * - integrate with presentation compiler for command completion (not urgent, hard) */ /** The main entry point of the REPL */ -object Main extends REPL
\ No newline at end of file +object Main extends REPL diff --git a/src/dotty/tools/dotc/repl/REPL.scala b/src/dotty/tools/dotc/repl/REPL.scala index cca5e8d6b..dd20852a4 100644 --- a/src/dotty/tools/dotc/repl/REPL.scala +++ b/src/dotty/tools/dotc/repl/REPL.scala @@ -90,7 +90,7 @@ object REPL { def input(in: Interpreter)(implicit ctx: Context): InteractiveReader = { val emacsShell = System.getProperty("env.emacs", "") != "" //println("emacsShell="+emacsShell) //debug - if (ctx.settings.Xnojline.value || emacsShell) new SimpleReader() + if (emacsShell) new SimpleReader() else InteractiveReader.createDefault(in) } |