swissChili | f3e7f18 | 2021-04-20 13:57:22 -0700 | [diff] [blame] | 1 | #include "compiler.h" |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 2 | #include "lisp.h" |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 3 | |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 4 | int main(int argc, char **argv) |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 5 | { |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 6 | if (argc < 2) |
swissChili | bed8092 | 2021-04-13 21:58:05 -0700 | [diff] [blame] | 7 | { |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 8 | puts("pass the string you want to parse as the first argument please"); |
swissChili | bed8092 | 2021-04-13 21:58:05 -0700 | [diff] [blame] | 9 | return 1; |
10 | } | ||||
11 | |||||
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 12 | struct istream *is = new_stristream_nt(argv[1]); |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 13 | |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 14 | struct environment env = compile_all(is); |
15 | value_t (*lisp_main)() = find_function(&env, "main")->def0; | ||||
16 | lisp_main(); | ||||
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 17 | |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 18 | // del_stristream (is); |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 19 | } |