diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-31 02:43:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-15 10:06:18 +0900 |
| commit | 788cfd8bcc932e545db73da282c48a9bad8ca271 (patch) | |
| tree | b386b8a6f2f1dc7a6042c15f13b2d929635816e5 /main.c | |
| parent | 8fba2c682d190236b0e4c82b71404e6cfb62d6d0 (diff) | |
| download | ducc-788cfd8bcc932e545db73da282c48a9bad8ca271.tar.gz ducc-788cfd8bcc932e545db73da282c48a9bad8ca271.tar.zst ducc-788cfd8bcc932e545db73da282c48a9bad8ca271.zip | |
feat: implement __FILE__ macro
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -2,6 +2,7 @@ // clang-format off #include "std.h" #include "common.c" +#include "io.c" #include "preprocess.c" #include "tokenize.c" #include "ast.c" @@ -13,13 +14,7 @@ int main(int argc, char** argv) { if (argc == 1) { fatal_error("usage: ducc <FILE>"); } - FILE* in; - if (strcmp(argv[1], "-") == 0) { - in = stdin; - } else { - in = fopen(argv[1], "rb"); - } - char* source = read_all(in); + InFile* source = read_all(argv[1]); PpToken* pp_tokens = preprocess(source); Token* tokens = tokenize(pp_tokens); Program* prog = parse(tokens); |
