Merge pull request #4874 from eatkins/drop-multi-command-validation

Don't validate multi commands
This commit is contained in:
eugene yokota 2019-07-17 23:40:17 -04:00 committed by GitHub
commit abb72ce10d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -189,13 +189,6 @@ object BasicCommands {
def multiParser(s: State): Parser[List[String]] = multiParserImpl(Some(s))
def multiApplied(state: State): Parser[() => State] = {
def generateCommands(commands: List[String]): State =
commands
.takeWhile(_ != "reload")
.collectFirst {
case c if Parser.parse(c, state.combinedParser).isLeft => c :: state
}
.getOrElse(commands ::: state)
Command.applyEffect(multiParserImpl(Some(state))) {
// the (@ _ :: _) ensures tail length >= 1.
case commands @ first :: (tail @ _ :: _) =>
@ -238,9 +231,9 @@ object BasicCommands {
}
}.headOption match {
case Some(s) => s()
case _ => generateCommands(commands)
case _ => commands ::: state
}
case commands => generateCommands(commands)
case commands => commands ::: state
}
}