blob: c9f9acd0f6ec2d52f19254fd8912b92f41968db3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;
}
|