diff options
author | Donna Malayeri <lindydonna@gmail.com> | 2010-07-20 16:18:54 +0000 |
---|---|---|
committer | Donna Malayeri <lindydonna@gmail.com> | 2010-07-20 16:18:54 +0000 |
commit | f7d2a3fa4e51b64f990244c6025bc7b769f76661 (patch) | |
tree | f939496e9e017d67279c062aaf2e4d936920d8bf /src | |
parent | 9972040b0f839de21496fb6fcfe5cb761b7e67b0 (diff) | |
download | scala-f7d2a3fa4e51b64f990244c6025bc7b769f76661.tar.gz scala-f7d2a3fa4e51b64f990244c6025bc7b769f76661.tar.bz2 scala-f7d2a3fa4e51b64f990244c6025bc7b769f76661.zip |
[scaladoc] Optionally run typer phase for Java ...
[scaladoc] Optionally run typer phase for Java files, if createJavadoc
method returns true. No review.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 9 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ScalaDoc.scala | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 768f207968..cca0760233 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -265,9 +265,11 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable override def specialized: Boolean = isSpecialized /** Is current phase cancelled on this unit? */ - def cancelled(unit: CompilationUnit) = - reporter.cancelled || - unit.isJava && this.id > currentRun.namerPhase.id + def cancelled(unit: CompilationUnit) = { + // run the typer only if in `createJavadoc` mode + val maxJavaPhase = if (createJavadoc) currentRun.typerPhase.id else currentRun.namerPhase.id + reporter.cancelled || unit.isJava && this.id > maxJavaPhase + } final def applyPhase(unit: CompilationUnit) { if (settings.debug.value) inform("[running phase " + name + " on " + unit + "]") @@ -975,4 +977,5 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable def forJVM : Boolean = settings.target.value startsWith "jvm" def forMSIL: Boolean = settings.target.value == "msil" def onlyPresentation = false + def createJavadoc = false } diff --git a/src/compiler/scala/tools/nsc/ScalaDoc.scala b/src/compiler/scala/tools/nsc/ScalaDoc.scala index b539b800b3..4354608e10 100644 --- a/src/compiler/scala/tools/nsc/ScalaDoc.scala +++ b/src/compiler/scala/tools/nsc/ScalaDoc.scala @@ -34,7 +34,9 @@ object ScalaDoc { val docSettings: doc.Settings = new doc.Settings(error) - reporter = new ConsoleReporter(docSettings) + reporter = new ConsoleReporter(docSettings) { + override def hasErrors = false // need to do this so that the Global instance doesn't trash all the symbols just because there was an error + } val command = new CompilerCommand(args.toList, docSettings) |