diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-06 18:00:47 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-06 18:00:47 +0000 |
commit | a0eb2bb268774a85411f037983d931f35bc7830f (patch) | |
tree | ec406296e052d7a0e6bae37f98e5693a7b2fffcd | |
parent | 0c45e33c1b8d094353a5585c44179d1818ff6e1e (diff) |
Change the output of the repl a lille bit
-rw-r--r-- | repl.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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"); |