diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-06 09:20:18 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-03-09 11:59:12 -0800 |
commit | e01c7eff032150f8460a76700542c214847ba115 (patch) | |
tree | b96812786a0d4f1ba53ed572b548a593720f5d70 /src/interactive/scala/tools/nsc/interactive/Main.scala | |
parent | 3d5c675982803e3a17262245a05266b2f5b64bc3 (diff) | |
download | scala-e01c7eff032150f8460a76700542c214847ba115.tar.gz scala-e01c7eff032150f8460a76700542c214847ba115.tar.bz2 scala-e01c7eff032150f8460a76700542c214847ba115.zip |
Moved interactive code into src/interactive.
As with scaladoc, pushes presentation compiler specific
code into its separate source area.
Diffstat (limited to 'src/interactive/scala/tools/nsc/interactive/Main.scala')
-rw-r--r-- | src/interactive/scala/tools/nsc/interactive/Main.scala | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/interactive/scala/tools/nsc/interactive/Main.scala b/src/interactive/scala/tools/nsc/interactive/Main.scala new file mode 100644 index 0000000000..3b4a36f62d --- /dev/null +++ b/src/interactive/scala/tools/nsc/interactive/Main.scala @@ -0,0 +1,34 @@ +/* NSC -- new Scala compiler + * Copyright 2005-2013 LAMP/EPFL + * @author Martin Odersky + */ + +package scala.tools +package nsc +package interactive + +/** The main class for NSC, a compiler for the programming + * language Scala. + */ +object Main extends nsc.MainClass { + override def processSettingsHook(): Boolean = { + if (this.settings.Yidedebug.value) { + this.settings.Xprintpos.value = true + this.settings.Yrangepos.value = true + val compiler = new interactive.Global(this.settings, this.reporter) + import compiler.{ reporter => _, _ } + + val sfs = command.files map getSourceFile + val reloaded = new interactive.Response[Unit] + askReload(sfs, reloaded) + + reloaded.get.right.toOption match { + case Some(ex) => reporter.cancelled = true // Causes exit code to be non-0 + case None => reporter.reset() // Causes other compiler errors to be ignored + } + askShutdown + false + } + else true + } +} |