summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/cmd')
-rw-r--r--src/compiler/scala/tools/cmd/CommandLine.scala4
-rw-r--r--src/compiler/scala/tools/cmd/FromString.scala2
-rw-r--r--src/compiler/scala/tools/cmd/Opt.scala2
-rw-r--r--src/compiler/scala/tools/cmd/Property.scala7
-rw-r--r--src/compiler/scala/tools/cmd/Reference.scala6
-rw-r--r--src/compiler/scala/tools/cmd/Spec.scala2
-rw-r--r--src/compiler/scala/tools/cmd/gen/AnyVals.scala484
-rw-r--r--src/compiler/scala/tools/cmd/gen/Codegen.scala39
-rw-r--r--src/compiler/scala/tools/cmd/gen/CodegenSpec.scala25
9 files changed, 12 insertions, 559 deletions
diff --git a/src/compiler/scala/tools/cmd/CommandLine.scala b/src/compiler/scala/tools/cmd/CommandLine.scala
index 781cc564cb..3a36a7d345 100644
--- a/src/compiler/scala/tools/cmd/CommandLine.scala
+++ b/src/compiler/scala/tools/cmd/CommandLine.scala
@@ -51,7 +51,7 @@ class CommandLine(val spec: Reference, val originalArgs: List[String]) extends C
/* Assumes known options have all been ruled out already. */
def isUnknown(opt: String) =
onlyKnownOptions && (opt startsWith "-") && {
- errorFn("Option '%s' not recognized.".format(opt))
+ errorFn(s"Option '$opt' not recognized.")
true
}
@@ -61,7 +61,7 @@ class CommandLine(val spec: Reference, val originalArgs: List[String]) extends C
case x :: Nil =>
expand(x) foreach (exp => return loop(exp))
if (isBinaryOption(x) && enforceArity)
- errorFn("Option '%s' requires argument, found EOF instead.".format(x))
+ errorFn(s"Option '$x' requires argument, found EOF instead.")
if (isUnaryOption(x)) mapForUnary(x)
else if (isUnknown(x)) Map()
diff --git a/src/compiler/scala/tools/cmd/FromString.scala b/src/compiler/scala/tools/cmd/FromString.scala
index 0b074efc0f..ab49c7507c 100644
--- a/src/compiler/scala/tools/cmd/FromString.scala
+++ b/src/compiler/scala/tools/cmd/FromString.scala
@@ -6,7 +6,7 @@
package scala.tools
package cmd
-import nsc.io.{ Path, File, Directory }
+import nsc.io.Directory
import scala.reflect.OptManifest
/** A general mechanism for defining how a command line argument
diff --git a/src/compiler/scala/tools/cmd/Opt.scala b/src/compiler/scala/tools/cmd/Opt.scala
index df3d0c4462..70756c5bb2 100644
--- a/src/compiler/scala/tools/cmd/Opt.scala
+++ b/src/compiler/scala/tools/cmd/Opt.scala
@@ -20,7 +20,7 @@ object Opt {
self: Implicit =>
protected def fail(msg: String) = runAndExit(println(programInfo.runner + ": " + msg))
- protected def failOption(arg: String, why: String) = fail("%s: '%s' is %s".format(opt, arg, why))
+ protected def failOption(arg: String, why: String) = fail(s"$opt: '$arg' is $why")
}
trait Implicit {
diff --git a/src/compiler/scala/tools/cmd/Property.scala b/src/compiler/scala/tools/cmd/Property.scala
index b1d951a5c4..18bedd6f7e 100644
--- a/src/compiler/scala/tools/cmd/Property.scala
+++ b/src/compiler/scala/tools/cmd/Property.scala
@@ -9,6 +9,7 @@ package cmd
import nsc.io._
import java.util.Properties
import java.io.FileInputStream
+import scala.sys.SystemProperties
/** Contains logic for translating a property key/value pair into
* equivalent command line arguments. The default settings will
@@ -58,14 +59,14 @@ trait Property extends Reference {
returning(new Properties)(_ load new FileInputStream(file.path))
def systemPropertiesToOptions: List[String] =
- propertiesToOptions(System.getProperties)
+ propertiesToOptions(new SystemProperties().toList)
def propertiesToOptions(file: File): List[String] =
propertiesToOptions(loadProperties(file))
def propertiesToOptions(props: java.util.Properties): List[String] = {
- import scala.collection.JavaConversions._
- propertiesToOptions(props.toList)
+ import scala.collection.JavaConverters._
+ propertiesToOptions(props.asScala.toList)
}
def propertiesToOptions(props: List[(String, String)]) = props flatMap propMapper
}
diff --git a/src/compiler/scala/tools/cmd/Reference.scala b/src/compiler/scala/tools/cmd/Reference.scala
index 62b6c893cf..25a16b1e3e 100644
--- a/src/compiler/scala/tools/cmd/Reference.scala
+++ b/src/compiler/scala/tools/cmd/Reference.scala
@@ -70,18 +70,18 @@ object Reference {
def addHelpAlias(f: () => String) = mapHelp { s =>
val str = "alias for '%s'" format f()
def noHelp = (helpFormatStr.format("", "")).length == s.length
- val str2 = if (noHelp) str else " (" + str + ")"
+ val str2 = if (noHelp) str else s" ($str)"
s + str2
}
def addHelpDefault(f: () => String): Unit = mapHelp { s =>
val str = "(default: %s)" format f()
- if (s.length + str.length < MaxLine) s + " " + str
+ if (s.length + str.length < MaxLine) s"$s $str"
else defaultFormatStr.format(s, str)
}
def addHelpEnvDefault(name: String): Unit = mapHelp { s =>
- val line1 = "%s (default: %s)".format(s, name)
+ val line1 = s"$s (default: $name)"
val envNow = envOrNone(name) map ("'" + _ + "'") getOrElse "unset"
val line2 = defaultFormatStr.format("Currently " + envNow)
diff --git a/src/compiler/scala/tools/cmd/Spec.scala b/src/compiler/scala/tools/cmd/Spec.scala
index a1cb31f911..069a7a89a1 100644
--- a/src/compiler/scala/tools/cmd/Spec.scala
+++ b/src/compiler/scala/tools/cmd/Spec.scala
@@ -47,6 +47,6 @@ object Spec {
}
class EnvironmentVar(val name: String) {
- override def toString = "${%s}" format name
+ override def toString = s"$${$name}"
}
}
diff --git a/src/compiler/scala/tools/cmd/gen/AnyVals.scala b/src/compiler/scala/tools/cmd/gen/AnyVals.scala
deleted file mode 100644
index e78589908c..0000000000
--- a/src/compiler/scala/tools/cmd/gen/AnyVals.scala
+++ /dev/null
@@ -1,484 +0,0 @@
-/* NSC -- new Scala compiler
- * Copyright 2007-2013 LAMP/EPFL
- * @author Paul Phillips
- */
-
-package scala.tools.cmd
-package gen
-
-/** Code generation of the AnyVal types and their companions. */
-trait AnyValReps {
- self: AnyVals =>
-
- sealed abstract class AnyValNum(name: String, repr: Option[String], javaEquiv: String)
- extends AnyValRep(name,repr,javaEquiv) {
-
- case class Op(op : String, doc : String)
-
- private def companionCoercions(tos: AnyValRep*) = {
- tos.toList map (to =>
- s"implicit def @javaequiv@2${to.javaEquiv}(x: @name@): ${to.name} = x.to${to.name}"
- )
- }
- def coercionComment =
-"""/** Language mandated coercions from @name@ to "wider" types. */
-import scala.language.implicitConversions"""
-
- def implicitCoercions: List[String] = {
- val coercions = this match {
- case B => companionCoercions(S, I, L, F, D)
- case S | C => companionCoercions(I, L, F, D)
- case I => companionCoercions(L, F, D)
- case L => companionCoercions(F, D)
- case F => companionCoercions(D)
- case _ => Nil
- }
- if (coercions.isEmpty) Nil
- else coercionComment.lines.toList ++ coercions
- }
-
- def isCardinal: Boolean = isIntegerType(this)
- def unaryOps = {
- val ops = List(
- Op("+", "/** Returns this value, unmodified. */"),
- Op("-", "/** Returns the negation of this value. */"))
-
- if(isCardinal)
- Op("~", "/**\n" +
- " * Returns the bitwise negation of this value.\n" +
- " * @example {{{\n" +
- " * ~5 == -6\n" +
- " * // in binary: ~00000101 ==\n" +
- " * // 11111010\n" +
- " * }}}\n" +
- " */") :: ops
- else ops
- }
-
- def bitwiseOps =
- if (isCardinal)
- List(
- Op("|", "/**\n" +
- " * Returns the bitwise OR of this value and `x`.\n" +
- " * @example {{{\n" +
- " * (0xf0 | 0xaa) == 0xfa\n" +
- " * // in binary: 11110000\n" +
- " * // | 10101010\n" +
- " * // --------\n" +
- " * // 11111010\n" +
- " * }}}\n" +
- " */"),
- Op("&", "/**\n" +
- " * Returns the bitwise AND of this value and `x`.\n" +
- " * @example {{{\n" +
- " * (0xf0 & 0xaa) == 0xa0\n" +
- " * // in binary: 11110000\n" +
- " * // & 10101010\n" +
- " * // --------\n" +
- " * // 10100000\n" +
- " * }}}\n" +
- " */"),
- Op("^", "/**\n" +
- " * Returns the bitwise XOR of this value and `x`.\n" +
- " * @example {{{\n" +
- " * (0xf0 ^ 0xaa) == 0x5a\n" +
- " * // in binary: 11110000\n" +
- " * // ^ 10101010\n" +
- " * // --------\n" +
- " * // 01011010\n" +
- " * }}}\n" +
- " */"))
- else Nil
-
- def shiftOps =
- if (isCardinal)
- List(
- Op("<<", "/**\n" +
- " * Returns this value bit-shifted left by the specified number of bits,\n" +
- " * filling in the new right bits with zeroes.\n" +
- " * @example {{{ 6 << 3 == 48 // in binary: 0110 << 3 == 0110000 }}}\n" +
- " */"),
-
- Op(">>>", "/**\n" +
- " * Returns this value bit-shifted right by the specified number of bits,\n" +
- " * filling the new left bits with zeroes.\n" +
- " * @example {{{ 21 >>> 3 == 2 // in binary: 010101 >>> 3 == 010 }}}\n" +
- " * @example {{{\n" +
- " * -21 >>> 3 == 536870909\n" +
- " * // in binary: 11111111 11111111 11111111 11101011 >>> 3 ==\n" +
- " * // 00011111 11111111 11111111 11111101\n" +
- " * }}}\n" +
- " */"),
-
- Op(">>", "/**\n" +
- " * Returns this value bit-shifted right by the specified number of bits,\n" +
- " * filling in the left bits with the same value as the left-most bit of this.\n" +
- " * The effect of this is to retain the sign of the value.\n" +
- " * @example {{{\n" +
- " * -21 >> 3 == -3\n" +
- " * // in binary: 11111111 11111111 11111111 11101011 >> 3 ==\n" +
- " * // 11111111 11111111 11111111 11111101\n" +
- " * }}}\n" +
- " */"))
- else Nil
-
- def comparisonOps = List(
- Op("==", "/** Returns `true` if this value is equal to x, `false` otherwise. */"),
- Op("!=", "/** Returns `true` if this value is not equal to x, `false` otherwise. */"),
- Op("<", "/** Returns `true` if this value is less than x, `false` otherwise. */"),
- Op("<=", "/** Returns `true` if this value is less than or equal to x, `false` otherwise. */"),
- Op(">", "/** Returns `true` if this value is greater than x, `false` otherwise. */"),
- Op(">=", "/** Returns `true` if this value is greater than or equal to x, `false` otherwise. */"))
-
- def otherOps = List(
- Op("+", "/** Returns the sum of this value and `x`. */"),
- Op("-", "/** Returns the difference of this value and `x`. */"),
- Op("*", "/** Returns the product of this value and `x`. */"),
- Op("/", "/** Returns the quotient of this value and `x`. */"),
- Op("%", "/** Returns the remainder of the division of this value by `x`. */"))
-
- // Given two numeric value types S and T , the operation type of S and T is defined as follows:
- // If both S and T are subrange types then the operation type of S and T is Int.
- // Otherwise the operation type of S and T is the larger of the two types wrt ranking.
- // Given two numeric values v and w the operation type of v and w is the operation type
- // of their run-time types.
- def opType(that: AnyValNum): AnyValNum = {
- val rank = IndexedSeq(I, L, F, D)
- (rank indexOf this, rank indexOf that) match {
- case (-1, -1) => I
- case (r1, r2) => rank apply (r1 max r2)
- }
- }
-
- def mkCoercions = numeric map (x => "def to%s: %s".format(x, x))
- def mkUnaryOps = unaryOps map (x => "%s\n def unary_%s : %s".format(x.doc, x.op, this opType I))
- def mkStringOps = List("def +(x: String): String")
- def mkShiftOps = (
- for (op <- shiftOps ; arg <- List(I, L)) yield
- "%s\n def %s(x: %s): %s".format(op.doc, op.op, arg, this opType I)
- )
-
- def clumps: List[List[String]] = {
- val xs1 = List(mkCoercions, mkUnaryOps, mkStringOps, mkShiftOps) map (xs => if (xs.isEmpty) xs else xs :+ "")
- val xs2 = List(
- mkBinOpsGroup(comparisonOps, numeric, _ => Z),
- mkBinOpsGroup(bitwiseOps, cardinal, this opType _),
- mkBinOpsGroup(otherOps, numeric, this opType _)
- )
- xs1 ++ xs2
- }
- def classLines = (clumps :+ commonClassLines).foldLeft(List[String]()) {
- case (res, Nil) => res
- case (res, lines) =>
- val xs = lines map {
- case "" => ""
- case s => interpolate(s)
- }
- res ++ xs
- }
- def objectLines = {
- val comp = if (isCardinal) cardinalCompanion else floatingCompanion
- interpolate(comp + allCompanions + "\n" + nonUnitCompanions).trim.lines.toList ++ (implicitCoercions map interpolate)
- }
-
- /** Makes a set of binary operations based on the given set of ops, args, and resultFn.
- *
- * @param ops list of function names e.g. List(">>", "%")
- * @param args list of types which should appear as arguments
- * @param resultFn function which calculates return type based on arg type
- * @return list of function definitions
- */
- def mkBinOpsGroup(ops: List[Op], args: List[AnyValNum], resultFn: AnyValNum => AnyValRep): List[String] = (
- ops flatMap (op =>
- args.map(arg =>
- "%s\n def %s(x: %s): %s".format(op.doc, op.op, arg, resultFn(arg))) :+ ""
- )
- ).toList
- }
-
- sealed abstract class AnyValRep(val name: String, val repr: Option[String], val javaEquiv: String) {
- def classLines: List[String]
- def objectLines: List[String]
- def commonClassLines = List(
- "override def getClass(): Class[@name@] = null"
- )
-
- def lcname = name.toLowerCase
- def boxedSimpleName = this match {
- case C => "Character"
- case I => "Integer"
- case _ => name
- }
- def boxedName = this match {
- case U => "scala.runtime.BoxedUnit"
- case _ => "java.lang." + boxedSimpleName
- }
- def zeroRep = this match {
- case L => "0L"
- case F => "0.0f"
- case D => "0.0d"
- case _ => "0"
- }
-
- def representation = repr.map(", a " + _).getOrElse("")
-
- def indent(s: String) = if (s == "") "" else " " + s
- def indentN(s: String) = s.lines map indent mkString "\n"
-
- def boxUnboxImpls = Map(
- "@boxRunTimeDoc@" -> """
- * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxTo%s`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
- *""".format(boxedSimpleName),
- "@boxImpl@" -> "%s.valueOf(x)".format(boxedName),
- "@unboxRunTimeDoc@" -> """
- * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxTo%s`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
- *""".format(name),
- "@unboxImpl@" -> "x.asInstanceOf[%s].%sValue()".format(boxedName, lcname),
- "@unboxDoc@" -> "the %s resulting from calling %sValue() on `x`".format(name, lcname)
- )
- def interpolations = Map(
- "@name@" -> name,
- "@representation@" -> representation,
- "@javaequiv@" -> javaEquiv,
- "@boxed@" -> boxedName,
- "@lcname@" -> lcname,
- "@zero@" -> zeroRep
- ) ++ boxUnboxImpls
-
- def interpolate(s: String): String = interpolations.foldLeft(s) {
- case (str, (key, value)) => str.replaceAll(key, value)
- }
- def classDoc = interpolate(classDocTemplate)
- def objectDoc = ""
- def mkImports = ""
-
- def mkClass = assemble("final abstract class " + name + " private extends AnyVal", classLines)
- def mkObject = assemble("object " + name + " extends AnyValCompanion", objectLines)
- def make() = List[String](
- headerTemplate,
- mkImports,
- classDoc,
- mkClass,
- objectDoc,
- mkObject
- ) mkString ""
-
- def assemble(decl: String, lines: List[String]): String = {
- val body = if (lines.isEmpty) " { }\n\n" else lines map indent mkString (" {\n", "\n", "\n}\n")
-
- decl + body + "\n"
- }
- override def toString = name
- }
-}
-
-trait AnyValTemplates {
- def headerTemplate = """/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// DO NOT EDIT, CHANGES WILL BE LOST
-// This auto-generated code can be modified in scala.tools.cmd.gen.
-// Afterwards, running tools/codegen-anyvals regenerates this source file.
-
-package scala
-
-"""
-
- def classDocTemplate = ("""
-/** `@name@`@representation@ (equivalent to Java's `@javaequiv@` primitive type) is a
- * subtype of [[scala.AnyVal]]. Instances of `@name@` are not
- * represented by an object in the underlying runtime system.
- *
- * There is an implicit conversion from [[scala.@name@]] => [[scala.runtime.Rich@name@]]
- * which provides useful non-primitive operations.
- */
-""".trim + "\n")
-
- def allCompanions = """
-/** Transform a value type into a boxed reference type.
- *@boxRunTimeDoc@
- * @param x the @name@ to be boxed
- * @return a @boxed@ offering `x` as its underlying value.
- */
-def box(x: @name@): @boxed@ = @boxImpl@
-
-/** Transform a boxed type into a value type. Note that this
- * method is not typesafe: it accepts any Object, but will throw
- * an exception if the argument is not a @boxed@.
- *@unboxRunTimeDoc@
- * @param x the @boxed@ to be unboxed.
- * @throws ClassCastException if the argument is not a @boxed@
- * @return @unboxDoc@
- */
-def unbox(x: java.lang.Object): @name@ = @unboxImpl@
-
-/** The String representation of the scala.@name@ companion object. */
-override def toString = "object scala.@name@"
-"""
-
- def nonUnitCompanions = "" // todo
-
- def cardinalCompanion = """
-/** The smallest value representable as a @name@. */
-final val MinValue = @boxed@.MIN_VALUE
-
-/** The largest value representable as a @name@. */
-final val MaxValue = @boxed@.MAX_VALUE
-"""
-
- def floatingCompanion = """
-/** The smallest positive value greater than @zero@ which is
- * representable as a @name@.
- */
-final val MinPositiveValue = @boxed@.MIN_VALUE
-final val NaN = @boxed@.NaN
-final val PositiveInfinity = @boxed@.POSITIVE_INFINITY
-final val NegativeInfinity = @boxed@.NEGATIVE_INFINITY
-
-/** The negative number with the greatest (finite) absolute value which is representable
- * by a @name@. Note that it differs from [[java.lang.@name@.MIN_VALUE]], which
- * is the smallest positive value representable by a @name@. In Scala that number
- * is called @name@.MinPositiveValue.
- */
-final val MinValue = -@boxed@.MAX_VALUE
-
-/** The largest finite positive number representable as a @name@. */
-final val MaxValue = @boxed@.MAX_VALUE
-"""
-}
-
-class AnyVals extends AnyValReps with AnyValTemplates {
- object B extends AnyValNum("Byte", Some("8-bit signed integer"), "byte")
- object S extends AnyValNum("Short", Some("16-bit signed integer"), "short")
- object C extends AnyValNum("Char", Some("16-bit unsigned integer"), "char")
- object I extends AnyValNum("Int", Some("32-bit signed integer"), "int")
- object L extends AnyValNum("Long", Some("64-bit signed integer"), "long")
- object F extends AnyValNum("Float", Some("32-bit IEEE-754 floating point number"), "float")
- object D extends AnyValNum("Double", Some("64-bit IEEE-754 floating point number"), "double")
- object Z extends AnyValRep("Boolean", None, "boolean") {
- def classLines = """
-/** Negates a Boolean expression.
- *
- * - `!a` results in `false` if and only if `a` evaluates to `true` and
- * - `!a` results in `true` if and only if `a` evaluates to `false`.
- *
- * @return the negated expression
- */
-def unary_! : Boolean
-
-/** Compares two Boolean expressions and returns `true` if they evaluate to the same value.
- *
- * `a == b` returns `true` if and only if
- * - `a` and `b` are `true` or
- * - `a` and `b` are `false`.
- */
-def ==(x: Boolean): Boolean
-
-/**
- * Compares two Boolean expressions and returns `true` if they evaluate to a different value.
- *
- * `a != b` returns `true` if and only if
- * - `a` is `true` and `b` is `false` or
- * - `a` is `false` and `b` is `true`.
- */
-def !=(x: Boolean): Boolean
-
-/** Compares two Boolean expressions and returns `true` if one or both of them evaluate to true.
- *
- * `a || b` returns `true` if and only if
- * - `a` is `true` or
- * - `b` is `true` or
- * - `a` and `b` are `true`.
- *
- * @note This method uses 'short-circuit' evaluation and
- * behaves as if it was declared as `def ||(x: => Boolean): Boolean`.
- * If `a` evaluates to `true`, `true` is returned without evaluating `b`.
- */
-def ||(x: Boolean): Boolean
-
-/** Compares two Boolean expressions and returns `true` if both of them evaluate to true.
- *
- * `a && b` returns `true` if and only if
- * - `a` and `b` are `true`.
- *
- * @note This method uses 'short-circuit' evaluation and
- * behaves as if it was declared as `def &&(x: => Boolean): Boolean`.
- * If `a` evaluates to `false`, `false` is returned without evaluating `b`.
- */
-def &&(x: Boolean): Boolean
-
-// Compiler won't build with these seemingly more accurate signatures
-// def ||(x: => Boolean): Boolean
-// def &&(x: => Boolean): Boolean
-
-/** Compares two Boolean expressions and returns `true` if one or both of them evaluate to true.
- *
- * `a | b` returns `true` if and only if
- * - `a` is `true` or
- * - `b` is `true` or
- * - `a` and `b` are `true`.
- *
- * @note This method evaluates both `a` and `b`, even if the result is already determined after evaluating `a`.
- */
-def |(x: Boolean): Boolean
-
-/** Compares two Boolean expressions and returns `true` if both of them evaluate to true.
- *
- * `a & b` returns `true` if and only if
- * - `a` and `b` are `true`.
- *
- * @note This method evaluates both `a` and `b`, even if the result is already determined after evaluating `a`.
- */
-def &(x: Boolean): Boolean
-
-/** Compares two Boolean expressions and returns `true` if they evaluate to a different value.
- *
- * `a ^ b` returns `true` if and only if
- * - `a` is `true` and `b` is `false` or
- * - `a` is `false` and `b` is `true`.
- */
-def ^(x: Boolean): Boolean
-
-override def getClass(): Class[Boolean] = null
- """.trim.lines.toList
-
- def objectLines = interpolate(allCompanions + "\n" + nonUnitCompanions).lines.toList
- }
- object U extends AnyValRep("Unit", None, "void") {
- override def classDoc = """
-/** `Unit` is a subtype of [[scala.AnyVal]]. There is only one value of type
- * `Unit`, `()`, and it is not represented by any object in the underlying
- * runtime system. A method with return type `Unit` is analogous to a Java
- * method which is declared `void`.
- */
-"""
- def classLines = List(
- """override def getClass(): Class[Unit] = null"""
- )
- def objectLines = interpolate(allCompanions).lines.toList
-
- override def boxUnboxImpls = Map(
- "@boxRunTimeDoc@" -> "",
- "@boxImpl@" -> "scala.runtime.BoxedUnit.UNIT",
- "@unboxRunTimeDoc@" -> "",
- "@unboxImpl@" -> "()",
- "@unboxDoc@" -> "the Unit value ()"
- )
- }
-
- def isSubrangeType = Set(B, S, C)
- def isIntegerType = Set(B, S, C, I, L)
- def isFloatingType = Set(F, D)
- def isWideType = Set(L, D)
-
- def cardinal = numeric filter isIntegerType
- def numeric = List(B, S, C, I, L, F, D)
- def values = List(U, Z) ++ numeric
-
- def make() = values map (x => (x.name, x.make()))
-}
diff --git a/src/compiler/scala/tools/cmd/gen/Codegen.scala b/src/compiler/scala/tools/cmd/gen/Codegen.scala
deleted file mode 100644
index c3aa527ef2..0000000000
--- a/src/compiler/scala/tools/cmd/gen/Codegen.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-/* NEST (New Scala Test)
- * Copyright 2007-2013 LAMP/EPFL
- * @author Paul Phillips
- */
-
-package scala.tools.cmd
-package gen
-
-class Codegen(args: List[String]) extends {
- val parsed = CodegenSpec(args: _*)
-} with CodegenSpec with Instance
-
-object Codegen {
- def echo(msg: String) = Console println msg
-
- def main(args0: Array[String]): Unit = {
- val runner = new Codegen(args0.toList)
- import runner._
-
- if (args0.isEmpty)
- return println (CodegenSpec.helpMsg)
-
- val out = outDir getOrElse { return println("--out is required.") }
- val all = genall || !anyvals
-
- echo("Generating sources into " + out)
-
- if (anyvals || all) {
- val av = new AnyVals { }
-
- av.make() foreach { case (name, code ) =>
- val file = (out / (name + ".scala")).toFile
- echo("Writing: " + file)
- file writeAll code
- }
- }
- }
-}
-
diff --git a/src/compiler/scala/tools/cmd/gen/CodegenSpec.scala b/src/compiler/scala/tools/cmd/gen/CodegenSpec.scala
deleted file mode 100644
index 4b4a1e482d..0000000000
--- a/src/compiler/scala/tools/cmd/gen/CodegenSpec.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-/* NEST (New Scala Test)
- * Copyright 2007-2013 LAMP/EPFL
- * @author Paul Phillips
- */
-
-package scala.tools.cmd
-package gen
-
-import FromString.ExistingDir
-
-trait CodegenSpec extends Spec with Meta.StdOpts with Interpolation {
- def referenceSpec = CodegenSpec
- def programInfo = Spec.Info("codegen", "", "scala.tools.cmd.gen.Codegen")
-
- help("Usage: codegen [<options>]")
-
- val outDir = "out" / "directory for generated files" --^ ExistingDir
- val anyvals = "anyvals" / "generate sources for AnyVal types" --?
- val genall = "all" / "generate sources for everything" --?
-}
-
-object CodegenSpec extends CodegenSpec with Reference {
- type ThisCommandLine = CommandLine
- def creator(args: List[String]): ThisCommandLine = new CommandLine(CodegenSpec, args)
-}