Fix double printing
This commit is contained in:
parent
bfb509f41f
commit
1e087c8339
3 changed files with 12 additions and 6 deletions
|
@ -24,19 +24,21 @@ class Repl {
|
|||
}
|
||||
|
||||
fun query(): Answers {
|
||||
val queryString = io.prompt("?-", { "" })
|
||||
val queryString = io.prompt("?-", { "| " })
|
||||
val simpleQuery = parser.parse(queryString)
|
||||
val query = preprocessor.preprocess(simpleQuery)
|
||||
Logger.debug("Satisfying query: $query")
|
||||
return query.satisfy(emptyMap())
|
||||
}
|
||||
|
||||
fun printAnswers(answers: Answers) {
|
||||
val knownCommands = setOf(";", "a", ".", "h")
|
||||
|
||||
if (answers.none()) {
|
||||
val iterator = answers.iterator()
|
||||
|
||||
if (!iterator.hasNext()) {
|
||||
io.say("false.")
|
||||
} else {
|
||||
val iterator = answers.iterator()
|
||||
var previous = iterator.next()
|
||||
io.say(prettyPrint(previous))
|
||||
|
||||
|
|
Reference in a new issue