summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-06-29 18:21:31 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-06-29 18:21:31 +0000
commit50768fba487e1ec08278cdc4be614863db32a5c4 (patch)
tree79f0e2f6724d2311a298fd58cab4e60a81c4c43b /main.c
parent64a411ede2df42eea0e6905a4985a3e54057c677 (diff)
Make parse return a list of clauses. Also pretty print the entire list of clauses.
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 504b02d..abad53b 100644
--- a/main.c
+++ b/main.c
@@ -29,7 +29,10 @@ main(int argc, char *argv[])
int fd = open(parsetestfile, OREAD);
if(fd < 0)
exits("open");
- parse(fd);
+ Term *prog = parse(fd);
+ Term *clause;
+ for(clause = prog; clause != nil; clause = clause->next)
+ print("%S.\n", prettyprint(clause));
}
exits(nil);