need to explicitly trim whitespace in semicolon separated commands now. fixes #261.

This commit is contained in:
Mark Harrah 2011-11-09 18:30:35 -05:00
parent e1652a2867
commit 03cd1ec3ab
2 changed files with 3 additions and 2 deletions

View File

@ -262,7 +262,7 @@ object BuiltinCommands
}
def multiParser(s: State): Parser[Seq[String]] =
( token(';' ~> OptSpace) flatMap { _ => matched(s.combinedParser | token(charClass(_ != ';').+, hide= const(true))) <~ token(OptSpace) } ).+
( token(';' ~> OptSpace) flatMap { _ => matched(s.combinedParser | token(charClass(_ != ';').+, hide= const(true))) <~ token(OptSpace) } map (_.trim) ).+
def multiApplied(s: State) =
Command.applyEffect( multiParser(s) )( _ ::: s )

View File

@ -1 +1,2 @@
> compile
# the ; clean ; part is to test that semicolon-separated commands work with spaces
> ; clean ; compile