diff options
| author | Felix Perktold <Felix.Perktold@student.uibk.ac.at> | 2025-12-21 14:53:26 +0100 |
|---|---|---|
| committer | Felix Perktold <Felix.Perktold@student.uibk.ac.at> | 2025-12-21 14:53:26 +0100 |
| commit | 20b1cea7a74a4feb759155eedbb6299bd891a325 (patch) | |
| tree | 2cf15c07d2284fff2d0d3cbd2fff55ce92345e20 /main.c | |
| parent | 4f025b96cfe6bc121ea9b37eb26d8814dd838647 (diff) | |
add tests
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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; +} |
