From 0a49cecf826a215cdccdc4b8fb7e568aa7d2730f Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 15 Jul 2008 17:02:57 +0000 Subject: fixed #1100 --- .../scala/util/parsing/combinator/Parsers.scala | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/library/scala/util/parsing/combinator/Parsers.scala b/src/library/scala/util/parsing/combinator/Parsers.scala index 1061b85ac8..04e4fa432a 100644 --- a/src/library/scala/util/parsing/combinator/Parsers.scala +++ b/src/library/scala/util/parsing/combinator/Parsers.scala @@ -596,13 +596,17 @@ trait Parsers { // assert(res.isInstanceOf[NoSuccess]) - if (!xs.isEmpty) { - // the next parser should start parsing where p failed, - // since `!p(in).successful', the next input to be consumed is `in' - Success(xs.toList, in) // TODO: I don't think in == res.next holds - } - else { - Failure(res.asInstanceOf[NoSuccess].msg, in0) + res match { + case e: Error => e + case _ => + if (!xs.isEmpty) { + // the next parser should start parsing where p failed, + // since `!p(in).successful', the next input to be consumed is `in' + Success(xs.toList, in) // TODO: I don't think in == res.next holds + } + else { + Failure(res.asInstanceOf[NoSuccess].msg, in0) + } } } -- cgit v1.2.3