summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-06-30 14:04:15 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-06-30 14:04:15 +0000
commitee4298a2cfbbd9e015cfc775d9d714a9f5035846 (patch)
tree8d6f4b139abf1a645e9e4fe0fba811f64b03839f /main.c
parent79d1fe1cf2eb6748e2c12ffe9c36a678655302b1 (diff)
Add a basic repl
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.c b/main.c
index 76d8e04..416e832 100644
--- a/main.c
+++ b/main.c
@@ -29,11 +29,15 @@ main(int argc, char *argv[])
int fd = open(parsetestfile, OREAD);
if(fd < 0)
exits("open");
- Term *prog = parse(fd);
+ Term *database = parse(fd, 0);
Term *goal;
- for(goal = initgoals; goal != nil; goal = goal->next)
- evalquery(prog, goal);
+ for(goal = initgoals; goal != nil; goal = goal->next){
+ Binding *bindings = nil;
+ evalquery(database, goal, &bindings);
+ }
+
+ repl(database);
}
exits(nil);