diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/Main.scala | 11 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ScalaDoc.scala | 45 |
2 files changed, 13 insertions, 43 deletions
diff --git a/src/compiler/scala/tools/nsc/Main.scala b/src/compiler/scala/tools/nsc/Main.scala index 9dbbda50b4..a3ff3b7fa3 100644 --- a/src/compiler/scala/tools/nsc/Main.scala +++ b/src/compiler/scala/tools/nsc/Main.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2007 LAMP/EPFL + * Copyright 2005-2008 LAMP/EPFL * @author Martin Odersky */ // $Id$ @@ -8,11 +8,9 @@ package scala.tools.nsc import java.io.File -import scala.tools.nsc.doc.DefaultDocDriver import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} import scala.tools.nsc.util.FakePos //{Position} - /** The main class for NSC, a compiler for the programming * language Scala. */ @@ -84,13 +82,6 @@ object Main extends AnyRef with EvalLoop { } else { val run = new compiler.Run run compile command.files - if (command.settings.doc.value) { - val generator = new DefaultDocDriver { - lazy val global: compiler.type = compiler - def settings = command.settings - } - generator.process(command.settings, run.units) - } reporter.printSummary() } } diff --git a/src/compiler/scala/tools/nsc/ScalaDoc.scala b/src/compiler/scala/tools/nsc/ScalaDoc.scala index c58fb440a7..021150ee2f 100644 --- a/src/compiler/scala/tools/nsc/ScalaDoc.scala +++ b/src/compiler/scala/tools/nsc/ScalaDoc.scala @@ -1,6 +1,7 @@ -/* NSC -- new Scala compiler - * Copyright 2005-2007 LAMP/EPFL +/* scaladoc, a documentation generator for Scala + * Copyright 2005-2008 LAMP/EPFL * @author Martin Odersky + * @author Geoffrey Washburn */ // $Id$ @@ -13,17 +14,15 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} import scala.tools.nsc.util.FakePos //{Position} -/** The main class for NSC, a compiler for the programming - * language Scala. +/** The main class for scaladoc, a frontend for the Scala compiler + * that generates documentation from source files. */ -object ScalaDoc extends AnyRef with EvalLoop { +object ScalaDoc { - val versionMsg = "Scala compiler " + + val versionMsg = "Scala documentation generator " + Properties.versionString + " -- " + Properties.copyrightString - val prompt = Properties.residentPromptString - var reporter: ConsoleReporter = _ def error(msg: String) { @@ -31,17 +30,6 @@ object ScalaDoc extends AnyRef with EvalLoop { msg + "\n scalac -help gives more information") } - /* needed ?? */ - //def errors() = reporter.errors - - def resident(compiler: Global) { - loop { line => - val args = List.fromString(line, ' ') - val command = new CompilerCommand(args, new Settings(error), error, true) - (new compiler.Run) compile command.files - } - } - def process(args: Array[String]) { val settings = new Settings(error) reporter = new ConsoleReporter(settings) @@ -76,23 +64,14 @@ object ScalaDoc extends AnyRef with EvalLoop { else if (command.settings.showPhases.value) reporter.info(null, compiler.phaseDescriptions, true) else { - if (command.settings.resident.value) - resident(compiler) - else if (command.files.isEmpty) { - reporter.info(null, command.usageMsg, true) - reporter.info(null, compiler.pluginOptionsHelp, true) - } else { val run = new compiler.Run run compile command.files - if (command.settings.doc.value) { - val generator = new DefaultDocDriver { - lazy val global: compiler.type = compiler - def settings = command.settings - } - generator.process(command.settings, run.units) - } + val generator = new DefaultDocDriver { + lazy val global: compiler.type = compiler + def settings = command.settings + } + generator.process(command.settings, run.units) reporter.printSummary() - } } } catch { case ex @ FatalError(msg) => |