diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-06-02 15:48:59 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-06-02 16:22:09 +0200 |
commit | dded5473c2fce3e6ad814536b0f604ebacba1e3a (patch) | |
tree | 09f1ac83cc0fcb4f56730ec396e28c7b5b804566 /src/dotty/tools/dotc/repl/REPL.scala | |
parent | 845b98186047f38013e2f6aa35508e974eedafb7 (diff) | |
download | dotty-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.scala | 13 |
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", "") != "" |