diff --git a/src/main.c b/src/main.c index 6133c80..a56a0ba 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ #include +#include #include "include/ast.h" #include "include/dstr.h" @@ -18,6 +19,12 @@ extern int yyparse(); int main(int argc, char** argv) { + if (argc - 1 && strlen(argv[1]) > 0 && (inp = argv[1]) && !yyparse()) { + log_dbg("Parsed successfully!\n"); + exec_print(exec_expr(root)); + exit(0); + } + while (1) { Dstr* ln = dstr_init(); char c;