Permalink
Browse files

Deleted unused discovered test parser/printer

  • Loading branch information...
1 parent 4bf4a80 commit ef4ce0f789cdce23042bdd486cd993deafd51f20 @harrah harrah committed Jul 9, 2013
Showing with 0 additions and 45 deletions.
  1. +0 −45 testing/impl/src/main/scala/sbt/TestParser.scala
@@ -3,23 +3,7 @@
*/
package sbt
-/* The following implements the simple syntax for storing test definitions.
-* The syntax is:
-*
-* definition := isModule? className typeSpecific
-* isModule := '<module>'
-* typeSpecific := annotated | subclass
-*
-* subclass := subclassSeparator className
-* subclassSeparator := '<<'
-*
-* annotated := annotationSeparator annotationName
-* annotationSeparator := '@'
-*/
-
- import scala.util.parsing.combinator._
import testing.{Fingerprint, AnnotatedFingerprint, TestFingerprint}
- import DiscoveredParser._
sealed abstract class Discovered extends Fingerprint with NotNull
{
@@ -42,32 +26,3 @@ final case class DiscoveredAnnotated(isModule: Boolean, className: String, annot
override def toString =
(if(isModule) IsModuleLiteral else "") + className + AnnotationSeparator + annotationName
}
-final class DiscoveredParser extends RegexParsers with NotNull
-{
- def definition: Parser[Discovered] =
- ( isModule ~! className ~! (SubSuperSeparator | AnnotationSeparator) ~! className ) ^^ {
- case module ~ name ~ SubSuperSeparator ~ superName => DiscoveredSubclass(module, name.trim, superName.trim)
- case module ~ name ~ AnnotationSeparator ~ annotation => DiscoveredAnnotated(module, name.trim, annotation.trim)
- }
-
- def isModule: Parser[Boolean] = (IsModuleLiteral?) ^^ (_.isDefined)
- def className: Parser[String] = ClassNameRegexString.r
-
- def parse(definitionString: String): Either[String, Discovered] =
- {
- def parseError(msg: String) = Left("Could not parse discovered definition '" + definitionString + "': " + msg)
- parseAll(definition, definitionString) match
- {
- case Success(result, next) => Right(result)
- case err: NoSuccess => parseError(err.msg)
- }
- }
-}
-object DiscoveredParser
-{
- val IsModuleLiteral = "<module>"
- val SubSuperSeparator = "<<"
- val AnnotationSeparator = "@"
- val ClassNameRegexString = """[^@<]+"""
- def parse(definitionString: String): Either[String, Discovered] = (new DiscoveredParser).parse(definitionString)
-}

0 comments on commit ef4ce0f

Please sign in to comment.