swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 1 | #include "lisp.h" |
swissChili | f3e7f18 | 2021-04-20 13:57:22 -0700 | [diff] [blame] | 2 | #include "compiler.h" |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 3 | |
| 4 | int main (int argc, char **argv) |
| 5 | { |
swissChili | bed8092 | 2021-04-13 21:58:05 -0700 | [diff] [blame] | 6 | if ( argc < 2 ) |
| 7 | { |
| 8 | puts ("pass the string you want to parse as the first argument please"); |
| 9 | return 1; |
| 10 | } |
| 11 | |
| 12 | struct istream *is = new_stristream_nt (argv[ 1 ]); |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 13 | |
swissChili | 8fc5e2f | 2021-04-22 13:45:10 -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 | 8fc5e2f | 2021-04-22 13:45:10 -0700 | [diff] [blame^] | 18 | // del_stristream (is); |
swissChili | 7a6f5eb | 2021-04-13 16:46:02 -0700 | [diff] [blame] | 19 | } |