#include "../includes/compiler.h" #include "../includes/test.h" #include #include #include int main(int argc, char *argv[]) { if (argc > 1) { if (strncmp(argv[1], "--test", 7) == 0) { // run tests fputs("Running header test (how does compile_string handle # headers?)\n", stderr); test_compile_line_header_depth(); } else { string output = (compile_line(argv[1], strnlen(argv[1], 1024), "")); puts(output); free(output); } } else { while (1) { printf("> "); char *buf = malloc(sizeof(*buf) * 1024); fgets(buf, 1024, stdin); string output = (compile_line(buf, 1024, "")); puts(output); free(output); } } }