summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-21 14:53:26 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2025-12-21 14:53:26 +0100
commit20b1cea7a74a4feb759155eedbb6299bd891a325 (patch)
tree2cf15c07d2284fff2d0d3cbd2fff55ce92345e20 /main.c
parent4f025b96cfe6bc121ea9b37eb26d8814dd838647 (diff)
add tests
Diffstat (limited to 'main.c')
-rw-r--r--main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..c9f9acd
--- /dev/null
+++ b/main.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+#include "lisp.h"
+#include "lex.yy.h"
+#include "lisp.tab.h"
+
+
+env *global_env = NULL;
+
+int main(void) {
+ // init global env
+ global_env = env_create(NULL);
+ // START REPL
+ char* line;
+ while ((line = readline("λ > ")) != NULL) {
+ if (*line) {
+ add_history(line);
+ }
+ yy_scan_string(line);
+ yyparse();
+ free(line);
+ }
+ return 0;
+}