diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-13 08:34:06 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-20 14:10:54 -0800 |
commit | 69d850c8993765e4b3008f8bcc99b90937df9ffb (patch) | |
tree | f222825234a7f17c88864ebca04882d20387f992 /src/compiler/scala/tools/cmd | |
parent | c54432c3e209f1ffbe3a05d0d7ee0532d20e4dd0 (diff) | |
download | scala-69d850c8993765e4b3008f8bcc99b90937df9ffb.tar.gz scala-69d850c8993765e4b3008f8bcc99b90937df9ffb.tar.bz2 scala-69d850c8993765e4b3008f8bcc99b90937df9ffb.zip |
Remove code from misc bits of the compiler.
They are everywhere.
They defy categorization.
They are... M I S C
Diffstat (limited to 'src/compiler/scala/tools/cmd')
-rw-r--r-- | src/compiler/scala/tools/cmd/FromString.scala | 9 | ||||
-rw-r--r-- | src/compiler/scala/tools/cmd/Reference.scala | 1 |
2 files changed, 1 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/cmd/FromString.scala b/src/compiler/scala/tools/cmd/FromString.scala index 2a624875ee..433bbb167e 100644 --- a/src/compiler/scala/tools/cmd/FromString.scala +++ b/src/compiler/scala/tools/cmd/FromString.scala @@ -24,18 +24,11 @@ abstract class FromString[+T](implicit t: ru.TypeTag[T]) extends PartialFunction } object FromString { - // We need these because we clash with the String => Path implicits. - private def toFile(s: String) = new File(new java.io.File(s)) + // We need this because we clash with the String => Path implicits. private def toDir(s: String) = new Directory(new java.io.File(s)) /** Path related stringifiers. */ - val ExistingFile: FromString[File] = new FromString[File]()(tagOfFile) { - override def isDefinedAt(s: String) = toFile(s).isFile - def apply(s: String): File = - if (isDefinedAt(s)) toFile(s) - else cmd.runAndExit(println("'%s' is not an existing file." format s)) - } val ExistingDir: FromString[Directory] = new FromString[Directory]()(tagOfDirectory) { override def isDefinedAt(s: String) = toDir(s).isDirectory def apply(s: String): Directory = diff --git a/src/compiler/scala/tools/cmd/Reference.scala b/src/compiler/scala/tools/cmd/Reference.scala index d4f2060f81..ec2a414065 100644 --- a/src/compiler/scala/tools/cmd/Reference.scala +++ b/src/compiler/scala/tools/cmd/Reference.scala @@ -26,7 +26,6 @@ trait Reference extends Spec { def isUnaryOption(s: String) = unary contains toOpt(s) def isBinaryOption(s: String) = binary contains toOpt(s) def isExpandOption(s: String) = expansionMap contains toOpt(s) - def isAnyOption(s: String) = isUnaryOption(s) || isBinaryOption(s) || isExpandOption(s) def expandArg(arg: String) = expansionMap.getOrElse(fromOpt(arg), List(arg)) |