diff --git a/main/parsers/CommandStrings.scala b/main/parsers/CommandStrings.scala deleted file mode 100755 index 297f157aa..000000000 --- a/main/parsers/CommandStrings.scala +++ /dev/null @@ -1,39 +0,0 @@ -package sbt.parse - - import Parser._ - -final class PropertyParser[A,B](propertyNames: ((Option[A], Option[B])) => Set[String], currentScope: (Option[A], Option[B]), - aNames: Set[String], bNames: Set[String], - resolveA: String => A, resolveB: String => B) -{ - val wsc = charClass(_.isWhitespace) - val ws = ( wsc + ) examples(" ") - val optWs = ( wsc * ) examples("") - - val nameChar = (c: Char) => idChar(c) && !(c == ',' || c == '*') - val idChar = (c: Char) => !(c.isWhitespace || c == ']' || c == '[') - - val Wildcard = '*' ^^^ None - def named[T](resolve: String => T, exs: Set[String]) = word(nameChar, exs) map { w => Some(resolve(w.mkString)) } - def key[T](resolve: String => T, exs: Set[String]) = token(optWs ~> (Wildcard | named(resolve, exs))) - val projectKey = key(resolveA, aNames) - val taskKey = key(resolveB, bNames) - - def ch(c: Char) = token(optWs ~ c) - def scopeBase = (ch('[') ~> projectKey) ~ ( ch(',') ~> taskKey <~ ch(']') ) - def scope = scopeBase ?? currentScope - - def word(valid: Char => Boolean, exs: Set[String]) = ( charClass(valid) +).string examples exs - def id(exs: Set[String]) = word(idChar, exs) - def value = token( any.+.string, "" ) - def propertyKey(sc: (Option[A], Option[B])) = token(id(propertyNames(sc)) map { (sc, _) } ) - def base(command: String) = (token(command) ~> scope <~ token(ws)) flatMap propertyKey - - val setBase = base("set") ~ (token(ws) ~> value) - val getBase = base("get") - - val setParser: Parser[SetConfig[A,B]] = setBase map { case scopeKey ~ key ~ value => new SetConfig(scopeKey, key, value) } - val getParser: Parser[GetConfig[A,B]] = getBase map { case scopeKey ~ key => new GetConfig(scopeKey, key) } -} -final class SetConfig[A,B](val scope: (Option[A], Option[B]), val propertyName: String, val propertyValue: String) -final class GetConfig[A,B](val scope: (Option[A], Option[B]), val propertyName: String) \ No newline at end of file diff --git a/project/build/XSbt.scala b/project/build/XSbt.scala index 0d42136d4..60193ad2e 100644 --- a/project/build/XSbt.scala +++ b/project/build/XSbt.scala @@ -57,8 +57,6 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths val webappSub = project("web", "Web App", new WebAppProject(_), ioSub, logSub, classpathSub, controlSub) // Embedded Scala code runner val runSub = baseProject("run", "Run", ioSub, logSub, classpathSub, processSub) - // Command parsers - val parsersSub = baseProject("main" / "parsers", "Command Parsers", completeSub) /***** compilation/discovery related modules *****/