aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/repl/REPL.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-06-02 15:48:59 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-06-02 16:22:09 +0200
commitdded5473c2fce3e6ad814536b0f604ebacba1e3a (patch)
tree09f1ac83cc0fcb4f56730ec396e28c7b5b804566 /src/dotty/tools/dotc/repl/REPL.scala
parent845b98186047f38013e2f6aa35508e974eedafb7 (diff)
downloaddotty-dded5473c2fce3e6ad814536b0f604ebacba1e3a.tar.gz
dotty-dded5473c2fce3e6ad814536b0f604ebacba1e3a.tar.bz2
dotty-dded5473c2fce3e6ad814536b0f604ebacba1e3a.zip
Add `initialCommands` and `cleanupCommands` to REPL
Diffstat (limited to 'src/dotty/tools/dotc/repl/REPL.scala')
-rw-r--r--src/dotty/tools/dotc/repl/REPL.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/repl/REPL.scala b/src/dotty/tools/dotc/repl/REPL.scala
index 977f67719..ae8f0b621 100644
--- a/src/dotty/tools/dotc/repl/REPL.scala
+++ b/src/dotty/tools/dotc/repl/REPL.scala
@@ -52,6 +52,19 @@ object REPL {
def context(ctx: Context): Context = ctx
+ /** The first interpreted commands always take a couple of seconds due to
+ * classloading. To bridge the gap, we warm up the interpreter by letting it
+ * interpret at least a dummy line while waiting for the first line of input
+ * to be entered.
+ */
+ val initialCommands: List[String] =
+ "val theAnswerToLifeInTheUniverseAndEverything = 21 * 2" :: Nil
+
+ /** We also allow the use of setting cleanup commands in the same manner.
+ * This is mainly due to supporting the SBT options to specify these commands
+ */
+ val cleanupCommands: List[String] = Nil
+
/** The default input reader */
def input(in: Interpreter)(implicit ctx: Context): InteractiveReader = {
val emacsShell = System.getProperty("env.emacs", "") != ""