diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2013-07-05 17:13:47 +0200 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2013-08-15 13:16:17 +0200 |
commit | 0459db43728e1dc38c3a1db6b7b1920810d0f858 (patch) | |
tree | 5565cd5e76fa6b40055156405da79f97553e76fd /src/compiler/scala/tools/cmd/CommandLineParser.scala | |
parent | f670e28d4da648511063c6825905c4960ee94445 (diff) | |
download | scala-0459db43728e1dc38c3a1db6b7b1920810d0f858.tar.gz scala-0459db43728e1dc38c3a1db6b7b1920810d0f858.tar.bz2 scala-0459db43728e1dc38c3a1db6b7b1920810d0f858.zip |
SI-7624 Fix a few remaining -Xlint warnings ...
in various places. This includes actors, compiler (mostly some new
macro parts) continuations, partest, scaladoc, scalap.
Diffstat (limited to 'src/compiler/scala/tools/cmd/CommandLineParser.scala')
-rw-r--r-- | src/compiler/scala/tools/cmd/CommandLineParser.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/cmd/CommandLineParser.scala b/src/compiler/scala/tools/cmd/CommandLineParser.scala index ef55178594..6132eff557 100644 --- a/src/compiler/scala/tools/cmd/CommandLineParser.scala +++ b/src/compiler/scala/tools/cmd/CommandLineParser.scala @@ -40,16 +40,16 @@ object CommandLineParser { // parse `in` for an argument, return it and the remainder of the input (or an error message) // (argument may be in single/double quotes, taking escaping into account, quotes are stripped) private def argument(in: String): Either[String, (String, String)] = in match { - case DoubleQuoted(arg, rest) => Right(arg, rest) - case SingleQuoted(arg, rest) => Right(arg, rest) - case Word(arg, rest) => Right(arg, rest) - case _ => Left("Illegal argument: "+ in) + case DoubleQuoted(arg, rest) => Right((arg, rest)) + case SingleQuoted(arg, rest) => Right((arg, rest)) + case Word(arg, rest) => Right((arg, rest)) + case _ => Left(s"Illegal argument: $in") } // parse a list of whitespace-separated arguments (ignoring whitespace in quoted arguments) @tailrec private def commandLine(in: String, accum: List[String] = Nil): Either[String, (List[String], String)] = { val trimmed = in.trim - if (trimmed.isEmpty) Right(accum.reverse, "") + if (trimmed.isEmpty) Right((accum.reverse, "")) else argument(trimmed) match { case Right((arg, next)) => (next span Character.isWhitespace) match { |