From ee4298a2cfbbd9e015cfc775d9d714a9f5035846 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Wed, 30 Jun 2021 14:04:15 +0000 Subject: Add a basic repl --- main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'main.c') 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); -- cgit v1.2.3