From 635b88be42124cf8afa450a32eda83a3698a44e2 Mon Sep 17 00:00:00 2001 From: michelou Date: Fri, 15 Dec 2006 15:04:50 +0000 Subject: added option 'unchecked' in Scalac Ant task and... added option 'unchecked' in Scalac Ant task and man page --- src/compiler/scala/tools/ant/Scalac.scala | 28 ++++++++++++++----- src/manual/scala/man1/Command.scala | 4 +-- src/manual/scala/man1/scalac.scala | 45 ++++++++++++++++--------------- 3 files changed, 48 insertions(+), 29 deletions(-) diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index 4957eb088a..22b0dc9105 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -1,7 +1,7 @@ /* __ ______________ *\ ** / |/ / ____/ ____/ ** ** / | | /___ / /___ ** -** /_/|__/_____/_____/ Copyright 2005-2006 LAMP/EPFL ** +** /_/|__/_____/_____/ Copyright 2005-2007 LAMP/EPFL ** ** ** \* */ @@ -51,9 +51,10 @@ package scala.tools.ant { *
  • logphase,
  • *
  • usepredefs,
  • *
  • debuginfo,
  • - *
  • addparams.
  • + *
  • addparams,
  • *
  • scalacdebugging,
  • - *
  • deprecation.
  • + *
  • deprecation,
  • + *
  • unchecked.
  • * *

    * It also takes the following parameters as nested elements: @@ -104,8 +105,10 @@ package scala.tools.ant { val values = List("jvm", "msil", "cldc") } - /** Defines valid values for the deprecation property. */ - object Deprecation extends PermissibleValue { + /** Defines valid values for the deprecation and + * unchecked properties. + */ + object Flag extends PermissibleValue { val values = List("yes", "no", "on", "off") } @@ -145,6 +148,8 @@ package scala.tools.ant { private var addParams: String = "" /** Instruct the compiler to generate deprecation information. */ private var deprecation: Boolean = false + /** Instruct the compiler to generate unchecked information. */ + private var unchecked: Boolean = false /** Whether the compiler is being debuged. Prints more information in case * in case of failure. */ @@ -345,11 +350,21 @@ package scala.tools.ant { * @param input One of the flags yes/no or on/off. */ def setDeprecation(input: String): Unit = - if (Deprecation.isPermissible(input)) + if (Flag.isPermissible(input)) deprecation = "yes".equals(input) || "on".equals(input) else error("Unknown deprecation flag '" + input + "'") + /** Set the unchecked info attribute. + * + * @param input One of the flags yes/no or on/off. + */ + def setUnchecked(input: String): Unit = + if (Flag.isPermissible(input)) + unchecked = "yes".equals(input) || "on".equals(input) + else + error("Unknown unchecked flag '" + input + "'") + /** Set the scalacdebugging info attribute. * * @param input The specified flag @@ -564,6 +579,7 @@ package scala.tools.ant { settings.nopredefs.value = !usepredefs settings.debuginfo.value = debugInfo settings.deprecation.value = deprecation + settings.unchecked.value = unchecked log("Scalac params = '" + addParams + "'", Project.MSG_DEBUG) var args = diff --git a/src/manual/scala/man1/Command.scala b/src/manual/scala/man1/Command.scala index 7a5aeb23a3..847e3c6383 100644 --- a/src/manual/scala/man1/Command.scala +++ b/src/manual/scala/man1/Command.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2006 LAMP/EPFL + * Copyright 2005-2007 LAMP/EPFL * @author Stephane Micheloud */ //$Id$ @@ -51,7 +51,7 @@ trait Command { //private val df = new java.text.SimpleDateFormat("MMM d, yyyy") //private val rightNow = new java.util.Date() - def lastModified: String = "September 20, 2006" // df.format(rightNow) + def lastModified: String = "December 15, 2006" // df.format(rightNow) def manpage: Document } diff --git a/src/manual/scala/man1/scalac.scala b/src/manual/scala/man1/scalac.scala index eb54944371..eb19270f78 100644 --- a/src/manual/scala/man1/scalac.scala +++ b/src/manual/scala/man1/scalac.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2006 LAMP/EPFL + * Copyright 2005-2007 LAMP/EPFL * @author Stephane Micheloud */ //$Id$ @@ -54,15 +54,9 @@ object scalac extends Command { Section("Standard Options", DefinitionList( Definition( - CmdOption("g"), - "Generate debugging info"), - Definition( - CmdOption("g:none"), - "Generate no debugging info"), - Definition( - CmdOption("g:{source,lines,vars,notc}"), + CmdOption("g:{none,source,lines,vars,notc}"), SeqPara( - "Generate only some debugging info.", + Mono("\"none\"") & " generates no debugging info,", Mono("\"source\"") & " generates only the source file attribute,", Mono("\"lines\"") & " generates source and line number information,", Mono("\"vars\"") & " generates source, line number and local " & @@ -72,6 +66,9 @@ object scalac extends Command { Definition( CmdOption("nowarn"), "Generate no warnings"), + Definition( + CmdOption("noassert"), + "Generate no assertions and assumptions"), Definition( CmdOption("verbose"), "Output messages about what the compiler is doing"), @@ -100,14 +97,6 @@ object scalac extends Command { Definition( CmdOption("d", Argument("directory")), "Specify where to place generated class files."), - Definition( - CmdOption("deprecation"), - SeqPara( - "Indicates whether source should be compiled with deprecation " & - "information; defaults to " & Mono("off") & " (" & - "accepted values are: " & Mono("on") & ", " & Mono("off") & - ", " & Mono("yes") & " and " & Mono("no") & ")", - "Available since Scala version 2.2.1")), Definition( CmdOption("encoding", Argument("encoding")), SeqPara( @@ -128,8 +117,19 @@ object scalac extends Command { CmdOption("migrate"), "Assist in migrating from Scala version 1.0."), Definition( - CmdOption("statistics"), - "Print compiler statistics."), + CmdOption("deprecation"), + SeqPara( + "Indicate whether source should be compiled with deprecation " & + "information; defaults to " & Mono("off") & " (" & + "accepted values are: " & Mono("on") & ", " & Mono("off") & + ", " & Mono("yes") & " and " & Mono("no") & ")", + "Available since Scala version 2.2.1")), + Definition( + CmdOption("unchecked"), + SeqPara( + "Enable detailed unchecked warnings", + "Non variable type-arguments in type patterns are unchecked " & + "since they are eliminated by erasure")), Definition( CmdOption("resident"), "Compiler stays resident, files to compile are read from standard " & @@ -142,7 +142,7 @@ object scalac extends Command { "Print a synopsis of standard options."), Definition( CmdOption("nouescape"), - "Disables handling of " & BSlash & "u unicode escapes"))), + "Disable handling of " & BSlash & "u unicode escapes"))), Section("Non-Standard Options", DefinitionList( @@ -175,6 +175,9 @@ object scalac extends Command { Definition( CmdOption("debug"), "Output debugging messages."), + Definition( + CmdOption("statistics"), + "Print compiler statistics."), Definition( CmdOption("explaintypes"), "Explain type errors in more detail."), @@ -338,7 +341,7 @@ object scalac extends Command { title = command date = lastModified // e.g. "June 8, 2006" author = "Stephane Micheloud" - version = "0.3" + version = "0.4" sections = List( name, synopsis, -- cgit v1.2.3