// Copyright (C) 2023, Jakob Wakeling // All rights reserved. #include "eval.h" #include "exec.h" #include "lex.h" #include "parse.h" #include bool Eflag, pflag; void eval(char *src, u64 len) { lex l = lex_init(src, len); if (Eflag) { lex_debug(&l); return; } for (ast *a; l.t.k != TK_EOF; ast_free(a)) { a = parse(&l); if (!a) { return; } if (pflag) { ast_debug(a, 0); continue; } _ret = execute(a, STDIN_FILENO, NULL); } }