From dfe729c98b63d0f6c0041799a0fb46b2f476502e Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Mon, 8 Jan 2024 18:31:56 -0800 Subject: allow for future FLI system --- main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index afa2e65..68e093e 100644 --- a/main.c +++ b/main.c @@ -1,14 +1,17 @@ +#include "builtins.h" #include "parser.h" #include #include #include #include - extern ht_t *WORD_TABLE; + extern array_t *STACK; extern char *INBUF; extern parser_t *PARSER; extern array_t *EVAL_STACK; +extern ht_t *OBJ_FREE_TABLE; +extern ht_t *FLIT; void usage() { printf("Usage: stem [-hv] [file]\n"); @@ -51,6 +54,11 @@ int main(int argc, char **argv) { STACK = init_array(10); WORD_TABLE = init_ht(500); EVAL_STACK = init_array(10); + FLIT = init_ht(500); + OBJ_FREE_TABLE = init_ht(500); + + add_funcs(); + while (1) { v = parser_get_next(PARSER); if (v == NULL) @@ -59,7 +67,9 @@ int main(int argc, char **argv) { } free(INBUF); - ht_free(WORD_TABLE); + ht_free(WORD_TABLE, value_free); + ht_free(FLIT, func_free); + ht_free(OBJ_FREE_TABLE, func_free); array_free(STACK); free(PARSER); array_free(EVAL_STACK); -- cgit