blob: 5679572e91aefa13e3b2416f66b7c6757015ab40 [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
swissChili53472e82021-05-08 16:06:32 -070012 struct istream *is = new_stristream_nt(argv[1]);
swissChili7a6f5eb2021-04-13 16:46:02 -070013
swissChili53472e82021-05-08 16:06:32 -070014 struct environment env = compile_all(is);
15 value_t (*lisp_main)() = find_function(&env, "main")->def0;
16 lisp_main();
swissChili7a6f5eb2021-04-13 16:46:02 -070017
swissChili53472e82021-05-08 16:06:32 -070018 // del_stristream (is);
swissChili7a6f5eb2021-04-13 16:46:02 -070019}