mirror of https://github.com/sbt/sbt.git
more release-worthy compile message and analysis toString
This commit is contained in:
parent
fa90cc7de6
commit
f0608da0a8
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package sbt
|
||||
|
||||
object Collections
|
||||
object Util
|
||||
{
|
||||
def separate[T,A,B](ps: Seq[T])(f: T => Either[A,B]): (Seq[A], Seq[B]) =
|
||||
((Nil: Seq[A], Nil: Seq[B]) /: ps)( (xs, y) => prependEither(xs, f(y)) )
|
||||
|
|
@ -14,4 +14,11 @@ object Collections
|
|||
case Left(l) => (l +: acc._1, acc._2)
|
||||
case Right(r) => (acc._1, r +: acc._2)
|
||||
}
|
||||
def counted(prefix: String, single: String, plural: String, count: Int): Option[String] =
|
||||
count match
|
||||
{
|
||||
case 0 => None
|
||||
case 1 => Some("1 " + prefix + single)
|
||||
case x => Some(x.toString + " " + prefix + plural)
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ package sbt.complete
|
|||
|
||||
import Parser._
|
||||
import sbt.Types.{left, right, some}
|
||||
import sbt.Collections.separate
|
||||
import sbt.Util.separate
|
||||
|
||||
sealed trait Parser[+T]
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue