blob: 615609fd0d017ad73822b1bfa532877ebfe2e42f (
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
27
28
29
30
31
32
33
34
35
36
37
38
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "parse.h"
#include "eval.h"
#include "list.h"
#include "env.h"
#include "linenoise.h"
int main(int argc, char **argv)
{
char *line;
struct list *env;
env = env_new();
linenoiseSetMultiLine(0);
while ((line = linenoise("> ")) != NULL)
{
linenoiseHistoryAdd(line);
if (strcmp(".clean", line) == 0)
{
env = env_new();
}
else
{
struct list *result = eval_str_env(line, env);
print_list(result, 0);
}
free(line);
}
return 0;
}
|