From cf19af27dc6dab3391d382a19e86fe2b7ebcc16a Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 13 Mar 2012 08:01:58 -0400 Subject: [PATCH] fix argument parsing, which unintentionally required two characters. ref #396 --- util/complete/Parsers.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/complete/Parsers.scala b/util/complete/Parsers.scala index 7a84a13a1..ef34ea5fc 100644 --- a/util/complete/Parsers.scala +++ b/util/complete/Parsers.scala @@ -43,6 +43,7 @@ trait Parsers lazy val NotSpaceClass = charClass(!_.isWhitespace, "non-whitespace character") lazy val SpaceClass = charClass(_.isWhitespace, "whitespace character") lazy val NotSpace = NotSpaceClass.+.string + lazy val OptNotSpace = NotSpaceClass.*.string lazy val Space = SpaceClass.+.examples(" ") lazy val OptSpace = SpaceClass.*.examples(" ") lazy val URIClass = URIChar.+.string !!! "Invalid URI" @@ -79,7 +80,7 @@ trait Parsers '\"' ^^^ '\"' | '\'' ^^^ '\'' | '\\' ^^^ '\\' | UnicodeEscape) lazy val UnicodeEscape: Parser[Char] = ("u" ~> repeat(HexDigit, 4, 4)) map { seq => Integer.parseInt(seq.mkString, 16).toChar } - lazy val NotQuoted = (NotDQuoteSpaceClass ~ NotSpace) map { case (c, s) => c.toString + s } + lazy val NotQuoted = (NotDQuoteSpaceClass ~ OptNotSpace) map { case (c, s) => c.toString + s } def repsep[T](rep: Parser[T], sep: Parser[_]): Parser[Seq[T]] = rep1sep(rep, sep) ?? Nil