From a0eb2bb268774a85411f037983d931f35bc7830f Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Tue, 6 Jul 2021 18:00:47 +0000 Subject: Change the output of the repl a lille bit --- repl.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/repl.c b/repl.c index 4269f8e..d179429 100644 --- a/repl.c +++ b/repl.c @@ -18,26 +18,31 @@ repl(void) choicestack = nil; goalstack = nil; /* should free old choicestack and goalstack */ int success; + int firsttime = 1; FindMore: success = evalquery(query, &bindings); + if(firsttime){ + print(" "); + firsttime = 0; + } if(success == 0) - print("false.\n"); + print(" false.\n"); else{ if(bindings == nil) - print("true.\n"); + print(" true"); else{ while(bindings){ print(" %S = %S%s", bindings->name, prettyprint(bindings->value, 0, 0, 0), - bindings->next ? " ,\n" : ""); + bindings->next ? ",\n " : ""); bindings = bindings->next; } } if(choicestack != nil){ - print(" "); + print("\n"); if(parsefindmore(fd) == L';'){ - print(";\n"); + print(";"); goto FindMore; }else print(".\n"); -- cgit v1.2.3