From ef4ce0f789cdce23042bdd486cd993deafd51f20 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 9 Jul 2013 14:55:30 -0400 Subject: [PATCH] Deleted unused discovered test parser/printer --- .../impl/src/main/scala/sbt/TestParser.scala | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/testing/impl/src/main/scala/sbt/TestParser.scala b/testing/impl/src/main/scala/sbt/TestParser.scala index af96f12ec..b482849e8 100644 --- a/testing/impl/src/main/scala/sbt/TestParser.scala +++ b/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 := '' -* 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 = "" - val SubSuperSeparator = "<<" - val AnnotationSeparator = "@" - val ClassNameRegexString = """[^@<]+""" - def parse(definitionString: String): Either[String, Discovered] = (new DiscoveredParser).parse(definitionString) -} \ No newline at end of file