fix ++ command to not require a space after it

This commit is contained in:
Mark Harrah 2011-08-14 10:53:37 -04:00
parent 90f25b234e
commit 18b57bb101
2 changed files with 3 additions and 3 deletions

View File

@ -17,9 +17,9 @@ object Cross
def switchParser(state: State): Parser[(String, String)] = def switchParser(state: State): Parser[(String, String)] =
{ {
val knownVersions = crossVersions(state) val knownVersions = crossVersions(state)
lazy val switchArgs = token(OptSpace ~> NotSpace.examples(knownVersions : _*)) ~ (token(Space ~> matched(state.combinedParser)) ?? "") lazy val switchArgs = token(NotSpace.examples(knownVersions : _*)) ~ (token(Space ~> matched(state.combinedParser)) ?? "")
lazy val nextSpaced = spacedFirst(Switch) lazy val nextSpaced = spacedFirst(Switch)
token(Switch) flatMap { _ => switchArgs & nextSpaced } token(Switch ~ OptSpace) flatMap { _ => switchArgs & nextSpaced }
} }
def spacedFirst(name: String) = opOrIDSpaced(name) ~ any.+ def spacedFirst(name: String) = opOrIDSpaced(name) ~ any.+

View File

@ -27,7 +27,7 @@ trait Parsers
if(DefaultParsers.matches(ID, s)) if(DefaultParsers.matches(ID, s))
OpChar | SpaceClass OpChar | SpaceClass
else if(DefaultParsers.matches(Op, s)) else if(DefaultParsers.matches(Op, s))
IDStart | SpaceClass IDChar | SpaceClass
else else
any any