From: momoyon Date: Sun, 11 May 2025 06:20:18 +0000 (+0500) Subject: [main.c] Check and error out on empty file. X-Git-Url: https://www.git.momoyon.org/?a=commitdiff_plain;h=937f6667dfa5a8a841b108c61e7fbba7495bf820;p=lang.git [main.c] Check and error out on empty file. --- diff --git a/main.c b/main.c index 2569dc8..2c67c93 100644 --- a/main.c +++ b/main.c @@ -1627,6 +1627,11 @@ int main(int argc, char **argv) { Lexer l = make_lexer(filename); + if (l.src.count == 0) { + log_error("That's an empty file, I don't know what to do with it..."); + return 1; + } + Tokens tokens = lex(&l); if (dump_tokens) {