diff options
author | michelou <michelou@epfl.ch> | 2011-07-20 21:52:50 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2011-07-20 21:52:50 +0000 |
commit | c0ddb8f941dcb4ec0ca0aae0739406352e17cdfa (patch) | |
tree | d2107fa9c923dbd53f1c17cd8d4b6159b15b7768 /src/compiler | |
parent | 628c0265aaeaab8ef84dfc623d45119972f83656 (diff) | |
download | scala-c0ddb8f941dcb4ec0ca0aae0739406352e17cdfa.tar.gz scala-c0ddb8f941dcb4ec0ca0aae0739406352e17cdfa.tar.bz2 scala-c0ddb8f941dcb4ec0ca0aae0739406352e17cdfa.zip |
4th round of clean ups (see r25293, r25285, r25...
4th round of clean ups (see r25293, r25285, r25292)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/reflect/internal/ClassfileConstants.scala | 49 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/FastScalac.scala | 52 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/Pack200Task.scala | 29 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/Same.scala | 27 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/ScalaTool.scala | 58 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/Scalac.scala | 208 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala | 38 |
7 files changed, 209 insertions, 252 deletions
diff --git a/src/compiler/scala/reflect/internal/ClassfileConstants.scala b/src/compiler/scala/reflect/internal/ClassfileConstants.scala index 839bfe90b8..18eba416f5 100644 --- a/src/compiler/scala/reflect/internal/ClassfileConstants.scala +++ b/src/compiler/scala/reflect/internal/ClassfileConstants.scala @@ -12,35 +12,26 @@ object ClassfileConstants { final val JAVA_MAJOR_VERSION = 45 final val JAVA_MINOR_VERSION = 3 - /** <p> - * (see http://java.sun.com/docs/books/jvms/second_edition/jvms-clarify.html) - * </p> - * <p> - * If the <code>ACC_INTERFACE</code> flag is set, the <code>ACC_ABSTRACT</code> - * flag must also be set (ch. 2.13.1). - * </p> - * <p> - * A class file cannot have both its <code>ACC_FINAL</code> and - * <code>ACC_ABSTRACT</code> flags set (ch. 2.8.2). - * </p> - * <p> - * A field may have at most one of its <code>ACC_PRIVATE</code>, - * <code>ACC_PROTECTED</code>, <code>ACC_PUBLIC</code> flags set (ch. 2.7.4). - * </p> - * <p> - * A field may not have both its <code>ACC_FINAL</code> and - * <code>ACC_VOLATILE</code> flags set (ch. 2.9.1). - * </p> - * <p> - * If a method has its <code>ACC_ABSTRACT</code> flag set it must not - * have any of its <code>ACC_FINAL</code>, <code>ACC_NATIVE</code>, - * <code>ACC_PRIVATE</code>, <code>ACC_STATIC</code>, <code>ACC_STRICT</code>, - * or <code>ACC_SYNCHRONIZED</code> flags set (ch. 2.13.3.2). - * </p> - * <p> - * All interface methods must have their <code>ACC_ABSTRACT</code> and - * <code>ACC_PUBLIC</code> flags set. - * </p> + /** (see http://java.sun.com/docs/books/jvms/second_edition/jvms-clarify.html) + * + * If the `ACC_INTERFACE` flag is set, the `ACC_ABSTRACT` flag must also + * be set (ch. 2.13.1). + * + * A class file cannot have both its `ACC_FINAL` and `ACC_ABSTRACT` flags + * set (ch. 2.8.2). + * + * A field may have at most one of its `ACC_PRIVATE`, `ACC_PROTECTED`, + * `ACC_PUBLIC` flags set (ch. 2.7.4). + * + * A field may not have both its `ACC_FINAL` and `ACC_VOLATILE` flags set + * (ch. 2.9.1). + * + * If a method has its `ACC_ABSTRACT` flag set it must not have any of its + * `ACC_FINAL`, `ACC_NATIVE`, `ACC_PRIVATE`, `ACC_STATIC`, `ACC_STRICT`, + * or `ACC_SYNCHRONIZED` flags set (ch. 2.13.3.2). + * + * All interface methods must have their `ACC_ABSTRACT` and + * `ACC_PUBLIC` flags set. */ // Class Field Method final val JAVA_ACC_PUBLIC = 0x0001 // X X X final val JAVA_ACC_PRIVATE = 0x0002 // X X diff --git a/src/compiler/scala/tools/ant/FastScalac.scala b/src/compiler/scala/tools/ant/FastScalac.scala index a2a7496824..ca60a55f02 100644 --- a/src/compiler/scala/tools/ant/FastScalac.scala +++ b/src/compiler/scala/tools/ant/FastScalac.scala @@ -6,21 +6,15 @@ ** |/ ** \* */ - package scala.tools.ant -/** <p> - * An Ant task to compile with the fast Scala compiler (<code>fsc</code>). - * </p> - * <p> - * In addition to the attributes shared with the <code>Scalac</code> - * task, this task also accepts the following attributes: - * </p> - * <ul style="font-family:Courier;"> - * <li>reset</li> - * <li>server</li> - * <li>shutdown</li> - * </ul> +/** An Ant task to compile with the fast Scala compiler (`fsc`). + * + * In addition to the attributes shared with the `Scalac` task, this task + * also accepts the following attributes: + * - `reset` + * - `server` + * - `shutdown` * * @author Stephane Micheloud */ @@ -36,27 +30,23 @@ class FastScalac extends Scalac { ** Properties setters ** \*============================================================================*/ - /** Sets the <code>reset</code> attribute. Used by Ant. + /** Sets the `reset` attribute. Used by [[http://ant.apache.org Ant]]. * - * @param input The value for <code>reset</code>. + * @param input The value for `reset`. */ - def setReset(input: Boolean): Unit = - resetCaches = input + def setReset(input: Boolean) { resetCaches = input } - /** Sets the <code>server</code> attribute. Used by Ant. + /** Sets the `server` attribute. Used by [[http://ant.apache.org Ant]]. * - * @param input The value for <code>server</code>. + * @param input The value for `server`. */ - def setServer(input: String): Unit = { - serverAddr = Some(input) - } + def setServer(input: String) { serverAddr = Some(input) } - /** Sets the <code>shutdown</code> attribute. Used by Ant. + /** Sets the `shutdown` attribute. Used by [[http://ant.apache.org Ant]]. * - * @param input The value for <code>shutdown</code>. + * @param input The value for `shutdown`. */ - def setShutdown(input: Boolean): Unit = - shutdownServer = input + def setShutdown(input: Boolean) { shutdownServer = input } /*============================================================================*\ ** The execute method ** @@ -75,10 +65,10 @@ class FastScalac extends Scalac { reset.value = resetCaches shutdown.value = shutdownServer - /** XXX Since fsc is largely unmaintained, the set of options being individually - * assessed here is likely to bear little relationship to the current set of options. - * Most likely this manifests in confusing and very difficult to debug behavior in fsc. - * We should warn or fix. + /** XXX Since fsc is largely unmaintained, the set of options being + * individually assessed here is likely to bear little relationship to + * the current set of options. Most likely this manifests in confusing + * and very difficult to debug behavior in fsc. We should warn or fix. */ val stringSettings = List(s.outdir, s.classpath, s.bootclasspath, s.extdirs, s.encoding) flatMap (x => List(x.name, x.value)) @@ -107,7 +97,7 @@ class FastScalac extends Scalac { buildError("Compile failed; see the compiler error output for details.") } catch { - case exception: Throwable if (exception.getMessage ne null) => + case exception: Throwable if exception.getMessage ne null => exception.printStackTrace() buildError("Compile failed because of an internal compiler error (" + exception.getMessage + "); see the error output for details.") diff --git a/src/compiler/scala/tools/ant/Pack200Task.scala b/src/compiler/scala/tools/ant/Pack200Task.scala index 5d74cff862..ff18ddff91 100644 --- a/src/compiler/scala/tools/ant/Pack200Task.scala +++ b/src/compiler/scala/tools/ant/Pack200Task.scala @@ -6,8 +6,6 @@ ** |/ ** \* */ -// $Id$ - package scala.tools.ant import java.io.{BufferedOutputStream, File, FileInputStream, @@ -18,18 +16,17 @@ import java.util.jar.Pack200.Packer._ import org.apache.tools.ant.{BuildException, DirectoryScanner} import org.apache.tools.ant.types.FileSet -/** <p> - * An Ant task that applies the pack200 encoding to a JAR file. - * </p><ul> - * <li>destdir (mandatory),</li> - * <li>dir (defaults to project's basedir),</li> - * <li>effort (default 9),</li> - * <li>keepFileOrder (default false),</li> - * <li>keepModificationTime (default false),</li> - * <li>repack (default false),</li> - * <li>segmentLimit (default -1 for no limit) </li> - * <li>suffix (default ".pack")</li> - * </ul> +/** An [[http://ant.apache.org Ant]] task that applies the pack200 encoding + * to a JAR file. + * + * - `destdir` (mandatory), + * - `dir` (defaults to project's basedir), + * - `effort` (default 9), + * - `keepFileOrder` (default `'''false'''`), + * - `keepModificationTime` (default `'''false'''`), + * - `repack` (default false), + * - `segmentLimit` (default `-1` for no limit), + * - `suffix` (default ".pack") * * @author James Matlik */ @@ -69,8 +66,8 @@ class Pack200Task extends ScalaMatchingTask { /** Set the flag to specify if file reordering should be performed. Reordering * is used to remove empty packages and improve pack200 optimization. * @param keep - * true to retain file ordering. - * false to optimize directory structure (DEFAULT). */ + * `'''true'''` to retain file ordering. + * `'''false'''` to optimize directory structure (DEFAULT). */ def setKeepFileOrder(x: Boolean) { keepFileOrder = x } /** If false, a single modification time is used for all contained files */ diff --git a/src/compiler/scala/tools/ant/Same.scala b/src/compiler/scala/tools/ant/Same.scala index 52bc440756..23210174ac 100644 --- a/src/compiler/scala/tools/ant/Same.scala +++ b/src/compiler/scala/tools/ant/Same.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ - package scala.tools.ant import java.io.{File, FileInputStream} @@ -16,18 +15,20 @@ import org.apache.tools.ant.util.{FileNameMapper, IdentityMapper} import org.apache.tools.ant.types.Mapper -/** <p> - * An Ant task that, for a set of files, tests them for byte-to-byte - * equality with one or more other files. - * This task supports the following parameters as attributes: - * </p><ul> - * <li>dir</li> - * <li>todir</li> - * <li>resultproperty (a property to be set when all tested files pairs are equal, if not set, the task will fail instead),</li> - * <li>failing (whether to stop if all files are not equal).</li></ul> - * <p>It also support the following nested elements:</p><ul> - * <li>mapper (a mapper from original files to test files).</li></ul> - * <p>This task itself defines a fileset that represents the set of original files.</p> +/** An Ant task that, for a set of files, tests them for byte-to-byte + * equality with one or more other files. + * + * This task supports the following parameters as attributes: + * - `dir` + * - `todir` + * - `resultproperty` (a property to be set when all tested files pairs are + * equal, if not set, the task will fail instead), + * - `failing` (whether to stop if all files are not equal). + * + * It also support the following nested elements: + * - `mapper` (a mapper from original files to test files). + * + * This task itself defines a fileset that represents the set of original files. * * @author Gilles Dubochet * @version 1.0 */ diff --git a/src/compiler/scala/tools/ant/ScalaTool.scala b/src/compiler/scala/tools/ant/ScalaTool.scala index ffe67b8229..35e26bd9f5 100644 --- a/src/compiler/scala/tools/ant/ScalaTool.scala +++ b/src/compiler/scala/tools/ant/ScalaTool.scala @@ -6,25 +6,23 @@ ** |/ ** \* */ - package scala.tools.ant import java.io.{File, InputStream, FileWriter} import org.apache.tools.ant.BuildException import org.apache.tools.ant.types.{Path, Reference} -/** <p> - * An Ant task that generates a shell or batch script to execute a - * Scala program. - * This task can take the following parameters as attributes: - * </p><ul> - * <li>file (mandatory),</li> - * <li>class (mandatory),</li> - * <li>platforms,</li> - * <li>classpath,</li> - * <li>properties,</li> - * <li>javaflags,</li> - * <li>toolflags.</li></ul> +/** An Ant task that generates a shell or batch script to execute a + * Scala program. + * + * This task can take the following parameters as attributes: + * - `file` (mandatory), + * - `class` (mandatory), + * - `platforms`, + * - `classpath`, + * - `properties`, + * - `javaflags`, + * - `toolflags`. * * @author Gilles Dubochet * @version 1.1 @@ -48,36 +46,36 @@ class ScalaTool extends ScalaMatchingTask { val values = List("unix", "windows") } - /** The path to the exec script file. ".bat" will be appended for the + /** The path to the exec script file. `".bat"` will be appended for the * Windows BAT file, if generated. */ private var file: Option[File] = None /** The main class to run. */ private var mainClass: Option[String] = None - /** Supported platforms for the script. Either "unix" or "windows". + /** Supported platforms for the script. Either `"unix"` or `"windows"`. * Defaults to both. */ private var platforms: List[String] = List("unix", "windows") /** An (optional) path to all JARs that this script depend on. Paths must be * relative to the scala home directory. If not set, all JAR archives and - * folders in "lib/" are automatically added. */ + * folders in `"lib/"` are automatically added. */ private var classpath: List[String] = Nil /** An (optional) path to JARs that this script depends on relative to the - * ant project's basedir. */ + * ant project's `basedir`. */ private var classpathPath: Path = emptyPath /** Comma-separated Java system properties to pass to the JRE. Properties - * are formatted as name=value. Properties scala.home, scala.tool.name and - * scala.tool.version are always set. */ + * are formatted as `name=value`. Properties `scala.home`, `scala.tool.name` + * and `scala.tool.version` are always set. */ private var properties: List[(String, String)] = Nil - /** Additional flags passed to the JRE ("java [javaFlags] class"). */ + /** Additional flags passed to the JRE (`"java [javaFlags] class"`). */ private var javaFlags: String = "" - /** Additional flags passed to the tool ("java class [toolFlags]"). Can only - * be set when a main class is defined. */ + /** Additional flags passed to the tool (`"java class [toolFlags]"`). + * Can only be set when a main class is defined. */ private var toolFlags: String = "" /*============================================================================*\ @@ -104,14 +102,14 @@ class ScalaTool extends ScalaMatchingTask { } } - /** - * Sets the classpath with which to run the tool. - * Note that this mechanism of setting the classpath is generally preferred - * for general purpose scripts, as this does not assume all elements are - * relative to the ant basedir. Additionally, the platform specific demarcation - * of any script variables (e.g. `${SCALA_HOME}` or `%SCALA_HOME%`) can be specified - * in a platform independant way (e.g. `@SCALA_HOME@`) and automatically translated - * for you. + /** Sets the classpath with which to run the tool. + * + * Note that this mechanism of setting the classpath is generally preferred + * for general purpose scripts, as this does not assume all elements are + * relative to the Ant `basedir`. Additionally, the platform specific + * demarcation of any script variables (e.g. `${SCALA_HOME}` or + * `%SCALA_HOME%`) can be specified in a platform independant way (e.g. + * `@SCALA_HOME@`) and automatically translated for you. */ def setClassPath(input: String) { classpath = classpath ::: input.split(",").toList diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index f8d5f74f50..01e35ac70a 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -6,7 +6,6 @@ ** |/ ** \* */ - package scala.tools.ant import java.io.{File,PrintWriter,BufferedWriter,FileWriter} @@ -20,51 +19,43 @@ import org.apache.tools.ant.util.{FileUtils, GlobPatternMapper, import scala.tools.nsc.{Global, Settings, CompilerCommand} import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} -/** <p> - * An Ant task to compile with the new Scala compiler (NSC). - * </p> - * <p> - * This task can take the following parameters as attributes: - * </p> - * <ul style="font-family:Courier;"> - * <li>srcdir (mandatory),</li> - * <li>srcref,</li> - * <li>destdir,</li> - * <li>classpath,</li> - * <li>classpathref,</li> - * <li>sourcepath,</li> - * <li>sourcepathref,</li> - * <li>bootclasspath,</li> - * <li>bootclasspathref,</li> - * <li>extdirs,</li> - * <li>extdirsref,</li> - * <li>encoding,</li> - * <li>target,</li> - * <li>force,</li> - * <li>fork,</li> - * <li>logging,</li> - * <li>logphase,</li> - * <li>debuginfo,</li> - * <li>addparams,</li> - * <li>scalacdebugging,</li> - * <li>deprecation,</li> - * <li>optimise,</li> - * <li>unchecked,</li> - * <li>failonerror,</li> - * <li>scalacdebugging,</li> - * <li>assemname,</li> - * <li>assemrefs.</li> - * </ul> - * <p> - * It also takes the following parameters as nested elements: - * </p> - * <ul> - * <li>src (for srcdir),</li> - * <li>classpath,</li> - * <li>sourcepath,</li> - * <li>bootclasspath,</li> - * <li>extdirs.</li> - * </ul> +/** An Ant task to compile with the new Scala compiler (NSC). + * + * This task can take the following parameters as attributes: + * - `srcdir` (mandatory), + * - `srcref`, + * - `destdir`, + * - `classpath`, + * - `classpathref`, + * - `sourcepath`, + * - `sourcepathref`, + * - `bootclasspath`, + * - `bootclasspathref`, + * - `extdirs`, + * - `extdirsref`, + * - `encoding`, + * - `target`, + * - `force`, + * - `fork`, + * - `logging`, + * - `logphase`, + * - `debuginfo`, + * - `addparams`, + * - `scalacdebugging`, + * - `deprecation`, + * - `optimise`, + * - `unchecked`, + * - `failonerror`, + * - `scalacdebugging`, + * - `assemname`, + * - `assemrefs`. + * + * It also takes the following parameters as nested elements: + * - `src` (for `srcdir`), + * - `classpath`, + * - `sourcepath`, + * - `bootclasspath`, + * - `extdirs`. * * @author Gilles Dubochet, Stephane Micheloud */ @@ -96,13 +87,12 @@ class Scalac extends ScalaMatchingTask with ScalacShared { "terminal") } - /** Defines valid values for the <code>target</code> property. */ + /** Defines valid values for the `target` property. */ object Target extends PermissibleValue { val values = List("jvm-1.5", "msil") } - /** Defines valid values for the <code>deprecation</code> and - * <code>unchecked</code> properties. */ + /** Defines valid values for the `deprecation` and `unchecked` properties. */ object Flag extends PermissibleValue { val values = List("yes", "no", "on", "off", "true", "false") def toBoolean(flag: String) = @@ -191,137 +181,137 @@ class Scalac extends ScalaMatchingTask with ScalacShared { \*============================================================================*/ - /** Sets the srcdir attribute. Used by Ant. - * @param input The value of <code>origin</code>. */ + /** Sets the srcdir attribute. Used by [[http://ant.apache.org Ant]]. + * @param input The value of `origin`. */ def setSrcdir(input: Path) { origin = setOrAppend(origin, input) } - /** Sets the <code>origin</code> as a nested src Ant parameter. + /** Sets the `origin` as a nested src Ant parameter. * @return An origin path to be configured. */ def createSrc(): Path = createNewPath(origin _, p => origin = p) - /** Sets the <code>origin</code> as an external reference Ant parameter. + /** Sets the `origin` as an external reference Ant parameter. * @param input A reference to an origin path. */ def setSrcref(input: Reference) = createSrc().setRefid(input) - /** Sets the <code>destdir</code> attribute. Used by Ant. - * @param input The value of <code>destination</code>. */ + /** Sets the `destdir` attribute. Used by [[http://ant.apache.org Ant]]. + * @param input The value of `destination`. */ def setDestdir(input: File) { destination = Some(input) } - /** Sets the <code>classpath</code> attribute. Used by Ant. - * @param input The value of <code>classpath</code>. */ + /** Sets the `classpath` attribute. Used by [[http://ant.apache.org Ant]]. + * @param input The value of `classpath`. */ def setClasspath(input: Path) { classpath = setOrAppend(classpath, input) } - /** Sets the <code>compilerPath</code> attribute. Used by Ant. - * @param input The value of <code>compilerPath</code>. */ + /** Sets the `compilerPath` attribute. Used by [[http://ant.apache.org Ant]]. + * @param input The value of `compilerPath`. */ def setCompilerPath(input : Path) { compilerPath = setOrAppend(compilerPath, input) } def createCompilerPath: Path = createNewPath(compilerPath _, p => compilerPath = p) - /** Sets the <code>compilerpathref</code> attribute. Used by Ant. - * @param input The value of <code>compilerpathref</code>. */ + /** Sets the `compilerpathref` attribute. Used by Ant. + * @param input The value of `compilerpathref`. */ def setCompilerPathRef(input: Reference) { createCompilerPath.setRefid(input) } - /** Sets the <code>classpath</code> as a nested classpath Ant parameter. + /** Sets the `classpath` as a nested classpath Ant parameter. * @return A class path to be configured. */ def createClasspath(): Path = createNewPath(classpath _, p => classpath = p) - /** Sets the <code>classpath</code> as an external reference Ant parameter. + /** Sets the `classpath` as an external reference Ant parameter. * @param input A reference to a class path. */ def setClasspathref(input: Reference) { createClasspath().setRefid(input) } - /** Sets the <code>sourcepath</code> attribute. Used by Ant. - * @param input The value of <code>sourcepath</code>. */ + /** Sets the `sourcepath` attribute. Used by [[http://ant.apache.org Ant]]. + * @param input The value of `sourcepath`. */ def setSourcepath(input: Path) { sourcepath = setOrAppend(sourcepath, input) } - /** Sets the <code>sourcepath</code> as a nested sourcepath Ant parameter. + /** Sets the `sourcepath` as a nested sourcepath Ant parameter. * @return A source path to be configured. */ def createSourcepath(): Path = createNewPath(sourcepath _, p => sourcepath = p) - /** Sets the <code>sourcepath</code> as an external reference Ant parameter. + /** Sets the `sourcepath` as an external reference Ant parameter. * @param input A reference to a source path. */ def setSourcepathref(input: Reference) { createSourcepath().setRefid(input) } - /** Sets the boot classpath attribute. Used by Ant. + /** Sets the boot classpath attribute. Used by [[http://ant.apache.org Ant]]. * - * @param input The value of <code>bootclasspath</code>. */ + * @param input The value of `bootclasspath`. */ def setBootclasspath(input: Path) { bootclasspath = setOrAppend(bootclasspath, input) } - /** Sets the <code>bootclasspath</code> as a nested sourcepath Ant + /** Sets the `bootclasspath` as a nested sourcepath Ant * parameter. * @return A source path to be configured. */ def createBootclasspath(): Path = createNewPath(bootclasspath _, p => bootclasspath = p) - /** Sets the <code>bootclasspath</code> as an external reference Ant + /** Sets the `bootclasspath` as an external reference Ant * parameter. * @param input A reference to a source path. */ def setBootclasspathref(input: Reference) = createBootclasspath().setRefid(input) /** Sets the external extensions path attribute. Used by Ant. - * @param input The value of <code>extdirs</code>. */ + * @param input The value of `extdirs`. */ def setExtdirs(input: Path) = extdirs = setOrAppend(extdirs, input) - /** Sets the <code>extdirs</code> as a nested sourcepath Ant parameter. + /** Sets the `extdirs` as a nested sourcepath Ant parameter. * @return An extensions path to be configured. */ def createExtdirs(): Path = createNewPath(extdirs _, p => extdirs = p) - /** Sets the <code>extdirs</code> as an external reference Ant parameter. + /** Sets the `extdirs` as an external reference Ant parameter. * @param input A reference to an extensions path. */ def setExtdirsref(input: Reference) = createExtdirs().setRefid(input) - /** Sets the <code>encoding</code> attribute. Used by Ant. - * @param input The value of <code>encoding</code>. */ + /** Sets the `encoding` attribute. Used by Ant. + * @param input The value of `encoding`. */ def setEncoding(input: String): Unit = encoding = Some(input) - /** Sets the <code>target</code> attribute. Used by Ant. - * @param input The value for <code>target</code>. */ + /** Sets the `target` attribute. Used by Ant. + * @param input The value for `target`. */ def setTarget(input: String): Unit = if (Target.isPermissible(input)) backend = Some(input) else buildError("Unknown target '" + input + "'") - /** Sets the <code>force</code> attribute. Used by Ant. - * @param input The value for <code>force</code>. */ + /** Sets the `force` attribute. Used by Ant. + * @param input The value for `force`. */ def setForce(input: Boolean) { force = input } - /** Sets the <code>fork</code> attribute. Used by Ant. - * @param input The value for <code>fork</code>. */ + /** Sets the `fork` attribute. Used by Ant. + * @param input The value for `fork`. */ def setFork(input : Boolean) { fork = input } /** - * Sets the <code>jvmargs</code> attribute. Used by Ant. - * @param input The value for <code>jvmargs</code> + * Sets the `jvmargs` attribute. Used by Ant. + * @param input The value for `jvmargs` */ def setJvmargs(input : String) { jvmArgs = Some(input) } /** Sets the logging level attribute. Used by Ant. - * @param input The value for <code>logging</code>. */ + * @param input The value for `logging`. */ def setLogging(input: String) { if (LoggingLevel.isPermissible(input)) logging = Some(input) else buildError("Logging level '" + input + "' does not exist.") } - /** Sets the <code>logphase</code> attribute. Used by Ant. - * @param input The value for <code>logPhase</code>. */ + /** Sets the `logphase` attribute. Used by Ant. + * @param input The value for `logPhase`. */ def setLogPhase(input: String) { logPhase = input.split(",").toList.flatMap { s: String => val st = s.trim() @@ -333,38 +323,38 @@ class Scalac extends ScalaMatchingTask with ScalacShared { } } - /** Set the <code>debug</code> info attribute. - * @param input The value for <code>debug</code>. */ + /** Set the `debug` info attribute. + * @param input The value for `debug`. */ def setDebuginfo(input: String) { debugInfo = Some(input) } - /** Set the <code>addparams</code> info attribute. - * @param input The value for <code>addparams</code>. */ + /** Set the `addparams` info attribute. + * @param input The value for `addparams`. */ def setAddparams(input: String) { addParams = input } - /** Set the <code>deprecation</code> info attribute. - * @param input One of the flags <code>yes/no</code> or <code>on/off</code>. */ + /** Set the `deprecation` info attribute. + * @param input One of the flags `yes/no` or `on/off`. */ def setDeprecation(input: String) { deprecation = Flag toBoolean input orElse buildError("Unknown deprecation flag '" + input + "'") } - /** Set the <code>optimise</code> info attribute. - * @param input One of the flags <code>yes/no</code> or <code>on/off</code>. */ + /** Set the `optimise` info attribute. + * @param input One of the flags `yes/no` or `on/off`. */ def setOptimise(input: String) { optimise = Flag toBoolean input orElse buildError("Unknown optimisation flag '" + input + "'") } - /** Set the <code>unchecked</code> info attribute. - * @param input One of the flags <code>yes/no</code> or <code>on/off</code>. */ + /** Set the `unchecked` info attribute. + * @param input One of the flags `yes/no` or `on/off`. */ def setUnchecked(input: String) { unchecked = Flag toBoolean input orElse buildError("Unknown unchecked flag '" + input + "'") } - /** Sets the <code>force</code> attribute. Used by Ant. - * @param input The value for <code>force</code>. */ + /** Sets the `force` attribute. Used by Ant. + * @param input The value for `force`. */ def setFailonerror(input: Boolean) { failonerror = input } - /** Set the <code>scalacdebugging</code> info attribute. If set to - * <code>true</code>, the scalac ant task will print out the filenames + /** Set the `scalacdebugging` info attribute. If set to + * `'''true'''`, the scalac ant task will print out the filenames * being compiled. * @param input The specified flag */ def setScalacdebugging(input: Boolean) { scalacDebugging = input } @@ -376,34 +366,34 @@ class Scalac extends ScalaMatchingTask with ScalacShared { ** Properties getters ** \*============================================================================*/ - /** Gets the value of the <code>classpath</code> attribute in a + /** Gets the value of the `classpath` attribute in a * Scala-friendly form. * @return The class path as a list of files. */ protected def getClasspath: List[File] = pathAsList(classpath, "classpath") - /** Gets the value of the <code>origin</code> attribute in a + /** Gets the value of the `origin` attribute in a * Scala-friendly form. * @return The origin path as a list of files. */ protected def getOrigin: List[File] = pathAsList(origin, "origin") - /** Gets the value of the <code>destination</code> attribute in a + /** Gets the value of the `destination` attribute in a * Scala-friendly form. * @return The destination as a file. */ protected def getDestination: File = if (destination.isEmpty) buildError("Member 'destination' is empty.") else existing(getProject().resolveFile(destination.get.toString)) - /** Gets the value of the <code>sourcepath</code> attribute in a + /** Gets the value of the `sourcepath` attribute in a * Scala-friendly form. * @return The source path as a list of files. */ protected def getSourcepath: List[File] = pathAsList(sourcepath, "sourcepath") - /** Gets the value of the <code>bootclasspath</code> attribute in a + /** Gets the value of the `bootclasspath` attribute in a * Scala-friendly form. * @return The boot class path as a list of files. */ protected def getBootclasspath: List[File] = pathAsList(bootclasspath, "bootclasspath") - /** Gets the value of the <code>extdirs</code> attribute in a + /** Gets the value of the `extdirs` attribute in a * Scala-friendly form. * @return The extensions path as a list of files. */ protected def getExtdirs: List[File] = pathAsList(extdirs, "extdirs") @@ -441,13 +431,13 @@ class Scalac extends ScalaMatchingTask with ScalacShared { /** Transforms a path into a Scalac-readable string. * @param path A path to convert. - * @return A string-representation of the path like <code>a.jar:b.jar</code>. */ + * @return A string-representation of the path like `a.jar:b.jar`. */ protected def asString(path: List[File]): String = path.map(asString).mkString(File.pathSeparator) /** Transforms a file into a Scalac-readable string. * @param path A file to convert. - * @return A string-representation of the file like <code>/x/k/a.scala</code>. */ + * @return A string-representation of the file like `/x/k/a.scala`. */ protected def asString(file: File): String = file.getAbsolutePath() diff --git a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala index 0948e072b4..05571b2424 100644 --- a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala +++ b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala @@ -3,38 +3,28 @@ * @author Martin Odersky */ - package scala.tools.nsc package backend import scala.tools.nsc.backend.icode._ import scala.collection.{ mutable, immutable } -/** - * Scala primitive operations are represented as methods in Any and - * AnyVal subclasses. Here we demultiplex them by providing a mapping - * from their symbols to integers. Different methods exist for - * different value types, but with the same meaning (like plus, minus, - * etc.). They will all be mapped to the same int. +/** Scala primitive operations are represented as methods in `Any` and + * `AnyVal` subclasses. Here we demultiplex them by providing a mapping + * from their symbols to integers. Different methods exist for + * different value types, but with the same meaning (like plus, minus, + * etc.). They will all be mapped to the same int. * - * <p>Note: The three equal methods have the following semantics:</p> - * <ul> - * <li> - * <code>"=="</code> checks for null, and if non-null, calls - * <code>java.lang.Object.equals</code><br/> - * <code>(class: Any; modifier: final)</code>. Primitive: EQ - * </li> - * <li> - * <code>"eq"</code> usual reference comparison<br/> - * <code>(class: AnyRef; modifier: final)</code>. Primitive: ID - * </li> - * <li> - * <code>"equals"</code> user-defined equality (Java semantics)<br/> - * <code>(class: Object; modifier: none)</code>. Primitive: EQUALS - * </li> - * </ul> + * Note: The three equal methods have the following semantics: + * - `"=="` checks for `null`, and if non-null, calls + * `java.lang.Object.equals` + * `(class: Any; modifier: final)`. Primitive: `EQ` + * - `"eq"` usual reference comparison + * `(class: AnyRef; modifier: final)`. Primitive: `ID` + * - `"equals"` user-defined equality (Java semantics) + * `(class: Object; modifier: none)`. Primitive: `EQUALS` * - * Inspired from the scalac compiler. + * Inspired from the `scalac` compiler. */ abstract class ScalaPrimitives { val global: Global |