This commit is contained in:
Tibo De Peuter 2025-05-02 23:50:29 +02:00
parent 80fb3d1e60
commit 5bfa1691dd
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
10 changed files with 276 additions and 17 deletions

View file

@ -42,10 +42,9 @@ class Repl {
val iterator = answers.iterator()
if (!iterator.hasNext()) {
io.say("false.")
io.say("false.\n")
} else {
var previous = iterator.next()
io.say(prettyPrint(previous))
io.say(prettyPrint(iterator.next()))
while (iterator.hasNext()) {
var command = io.prompt("")
@ -57,8 +56,7 @@ class Repl {
when (command) {
";" -> {
previous = iterator.next()
io.say(prettyPrint(previous))
io.say(prettyPrint(iterator.next()))
}
"a" -> return
"." -> return
@ -88,7 +86,7 @@ class Repl {
val subs = result.getOrNull()!!
if (subs.isEmpty()) {
io.checkNewLine()
return "true.\n"
return "true."
}
return subs.entries.joinToString(",\n") { "${it.key} = ${it.value}" }
},