Revert "Address problems reported by Codacy"

This reverts commit 1bda41fc31.
This commit is contained in:
Eugene Yokota 2016-11-29 05:59:06 -05:00
parent 3e653f73b3
commit 33330c9d62
1 changed files with 7 additions and 5 deletions

View File

@ -232,6 +232,12 @@ object Parser extends ParserMain {
}
}
def combinedParser[A](a: Parser[A], b: Parser[A]): Parser[Seq[A]] =
if (a.valid)
if (b.valid) new CombiningParser(a, b) else a.map(Seq(_))
else
b.map(Seq(_))
def choiceParser[A, B](a: Parser[A], b: Parser[B]): Parser[Either[A, B]] =
if (a.valid)
if (b.valid) new HetParser(a, b) else a.map(left.fn)
@ -312,11 +318,7 @@ trait ParserMain {
def filter(f: A => Boolean, msg: String => String): Parser[A] = filterParser(a, f, "", msg)
def string(implicit ev: A <:< Seq[Char]): Parser[String] = map(_.mkString)
def flatMap[B](f: A => Parser[B]) = bindParser(a, f)
def combinedWith(b: Parser[A]): Parser[Seq[A]] =
if (a.valid)
if (b.valid) new CombiningParser(a, b) else a.map(Seq(_))
else
b.map(Seq(_))
def combinedWith(b: Parser[A]): Parser[Seq[A]] = combinedParser(a, b)
}
implicit def literalRichCharParser(c: Char): RichParser[Char] = richParser(c)