diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-26 22:52:11 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-26 22:52:11 -0600 |
commit | f5bc8b2ba9e2eb8ea53d49d67dbd8e00d4702d68 (patch) | |
tree | d83274bca35de1ef238b2888ff35291d4dbad24b | |
parent | 2f6007fbe3131b24c22f139dbd4d317b668aef9b (diff) | |
download | scala-test-more-f5bc8b2ba9e2eb8ea53d49d67dbd8e00d4702d68.tar.gz scala-test-more-f5bc8b2ba9e2eb8ea53d49d67dbd8e00d4702d68.zip |
more cleanup
-rw-r--r-- | src/main/scala/org/perl8/test/tap/Parser.scala | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/main/scala/org/perl8/test/tap/Parser.scala b/src/main/scala/org/perl8/test/tap/Parser.scala index 8674c18..f422b4e 100644 --- a/src/main/scala/org/perl8/test/tap/Parser.scala +++ b/src/main/scala/org/perl8/test/tap/Parser.scala @@ -111,20 +111,14 @@ class Parser (cb: TAPEvent => Unit) extends Parsers { } } - private def LineParser[T] ( - lineType: String - )( + private def LineParser[T] (lineType: String)( body: Input => ParseResult[T] - ): Parser[T] = { - new Parser[T] { - def apply (in: Input): ParseResult[T] = { - if (in.atEnd) { - Failure(lineType + " line expected, but end of input found", in) - } - else { - body(in) - } - } + ): Parser[T] = Parser { in => + if (in.atEnd) { + Failure(lineType + " line expected, but end of input found", in) + } + else { + body(in) } } |