diff options
author | Paul Phillips <paulp@improving.org> | 2011-05-31 05:08:25 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-05-31 05:08:25 +0000 |
commit | edad717cc1934d80dc0b6a9af528eed8ef4b30b6 (patch) | |
tree | abd8506f32326d513177569192c0ae5d546cae8a /src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala | |
parent | 35f7c2bde563b501e9661aace1e1610990b51544 (diff) | |
download | scala-edad717cc1934d80dc0b6a9af528eed8ef4b30b6.tar.gz scala-edad717cc1934d80dc0b6a9af528eed8ef4b30b6.tar.bz2 scala-edad717cc1934d80dc0b6a9af528eed8ef4b30b6.zip |
Working on the finer points of the Total Repl E...
Working on the finer points of the Total Repl Experience. Some of what
is in this patch:
-- Instantaneous repl startup. Closes #4561.
-- SIGINT handler installed last. If you've been annoyed at the repl
being difficult to interrupt during its initialization, this one is
especially for you.
-- Started abstracting out some bits which would go into an API and
reconfiguring the repl in those terms.
For a good time, call S-C-A-L-A -Dscala.repl.power. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala new file mode 100644 index 0000000000..ab0911d374 --- /dev/null +++ b/src/compiler/scala/tools/nsc/interpreter/ReplReporter.scala @@ -0,0 +1,22 @@ +/* NSC -- new Scala compiler + * Copyright 2002-2011 LAMP/EPFL + * @author Paul Phillips + */ + +package scala.tools.nsc +package interpreter + +import reporters._ +import IMain._ + +class ReplReporter(intp: IMain) extends ConsoleReporter(intp.settings, null, new ReplStrippingWriter(intp)) { + override def printMessage(msg: String) { + // Avoiding deadlock if the compiler starts logging before + // the lazy val is complete. + if (intp.isInitializeComplete) { + if (intp.totalSilence) () + else super.printMessage(msg) + } + else Console.println(msg) + } +} |