make ; a hard delimiter for multi-commands. fixes #270

This commit is contained in:
Mark Harrah 2011-12-13 17:29:08 -05:00
parent bca9ace1f7
commit 68027501f8
1 changed files with 5 additions and 1 deletions

View File

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