summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-01-08 15:39:19 -0800
committerPreston Pan <preston@nullring.xyz>2023-01-08 15:39:19 -0800
commit19367a27472a06634424e56c1eb21e4f53da4e9e (patch)
treefc58a08d36d451bdd1e7143a7358ac8a374355f7 /src/main.c
parent87d82ead963c24d84a4f6e417b96b9bf73d132bb (diff)
fixed invalid read; some memory leakage fixed but not completely
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index ba710bf..1d68cdb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -132,7 +132,9 @@ int main(int argc, char **argv) {
printf("nxs, version 1.2 alpha\n");
exit(0);
} else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--repl") == 0) {
- /* Start a REPL */
+ printf("Welcome to the NoExcess REPL.\n");
+ while (true) {
+ }
}
char *filename = argv[1];
@@ -162,8 +164,14 @@ int main(int argc, char **argv) {
lexer_t *lexer = init_lexer(buffer);
parser_t *parser = init_parser(lexer);
visitor_t *visitor = init_visitor(parser);
- eval(visitor);
+ ast_t *root = eval(visitor);
/* print_root(root); */
+ ast_free(root);
+ free(visitor);
+ hash_table_free(parser->symbol_table);
+ parser_free(parser);
+ free(lexer);
+ free(buffer);
}
return 0;