From f5bc8b2ba9e2eb8ea53d49d67dbd8e00d4702d68 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 26 Feb 2013 22:52:11 -0600 Subject: more cleanup --- src/main/scala/org/perl8/test/tap/Parser.scala | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src') 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) } } -- cgit v1.2.3-54-g00ecf