summaryrefslogtreecommitdiff
path: root/repl.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-06 18:00:47 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-06 18:00:47 +0000
commita0eb2bb268774a85411f037983d931f35bc7830f (patch)
treeec406296e052d7a0e6bae37f98e5693a7b2fffcd /repl.c
parent0c45e33c1b8d094353a5585c44179d1818ff6e1e (diff)
Change the output of the repl a lille bit
Diffstat (limited to 'repl.c')
-rw-r--r--repl.c15
1 files 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");