blob: c39faac4dea52625ab13798eba4d157ba8fb7118 [file] [log] [blame]
swissChilif3e7f182021-04-20 13:57:22 -07001#include "compiler.h"
swissChili53472e82021-05-08 16:06:32 -07002#include "lisp.h"
swissChili7a6f5eb2021-04-13 16:46:02 -07003
swissChili53472e82021-05-08 16:06:32 -07004int main(int argc, char **argv)
swissChili7a6f5eb2021-04-13 16:46:02 -07005{
swissChili53472e82021-05-08 16:06:32 -07006 if (argc < 2)
swissChilibed80922021-04-13 21:58:05 -07007 {
swissChili53472e82021-05-08 16:06:32 -07008 puts("pass the string you want to parse as the first argument please");
swissChilibed80922021-04-13 21:58:05 -07009 return 1;
10 }
11
swissChili923b5362021-05-09 20:31:43 -070012 struct istream *is = new_fistream(argv[1], false);
13
14 if (is == NULL)
15 {
16 fprintf(stderr, "Could not open %s\n", argv[1]);
17 return 1;
18 }
swissChili7a6f5eb2021-04-13 16:46:02 -070019
swissChili3ec55cf2021-05-28 08:23:23 -070020<<<<<<< HEAD
swissChili53472e82021-05-08 16:06:32 -070021 struct environment env = compile_all(is);
22 value_t (*lisp_main)() = find_function(&env, "main")->def0;
23 lisp_main();
swissChili7a6f5eb2021-04-13 16:46:02 -070024
swissChili923b5362021-05-09 20:31:43 -070025 del_fistream(is);
swissChili3ec55cf2021-05-28 08:23:23 -070026=======
27 struct environment env = compile_all (is);
28 value_t (*lisp_main) () = find_function(&env, "main")->def0;
29 lisp_main ();
30>>>>>>> 6afa62d (Remove free)
swissChili7a6f5eb2021-04-13 16:46:02 -070031}