From b0b976ee522d2e52f20d6bdd44ed9d22f1f1fc56 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sun, 23 Jun 2024 17:40:56 +0200 Subject: [PATCH] Fix JSON and compile issue. --- src/build/build_options.c | 276 ++++++++++++++-------------- src/compiler/headers.c | 184 +++++++++---------- src/compiler/json_output.c | 44 ++--- src/compiler/sema_name_resolution.c | 3 +- 4 files changed, 253 insertions(+), 254 deletions(-) diff --git a/src/build/build_options.c b/src/build/build_options.c index ed05695e5..01985dd1d 100644 --- a/src/build/build_options.c +++ b/src/build/build_options.c @@ -48,138 +48,138 @@ const char *trust_level[3] = { }; #define EOUTPUT(string, ...) fprintf(stderr, string "\n", ##__VA_ARGS__) -#define OUTPUT(string, ...) fprintf(stdout, string "\n", ##__VA_ARGS__) +#define PRINTF(string, ...) fprintf(stdout, string "\n", ##__VA_ARGS__) // NOLINT #define FAIL_WITH_ERR(string, ...) do { fprintf(stderr, "Error: " string "\n\n", ##__VA_ARGS__); usage(); exit_compiler(EXIT_FAILURE); } while (0) static void usage(void) { - OUTPUT("Usage: %s [] []", args[0]); - OUTPUT(""); - OUTPUT("Commands:"); - OUTPUT(""); - OUTPUT(" compile [ ...] Compile files without a project into an executable."); - OUTPUT(" init Initialize a new project structure."); - OUTPUT(" init-lib Initialize a new library structure."); - OUTPUT(" build [] Build the target in the current project."); - OUTPUT(" benchmark Run the benchmarks in the current project."); - OUTPUT(" test Run the unit tests in the current project."); - OUTPUT(" clean Clean all build files."); - OUTPUT(" run [] Run (and build if needed) the target in the current project."); - OUTPUT(" dist [] Clean and build a target for distribution."); - OUTPUT(" directives [] Generate documentation for the target."); - OUTPUT(" bench [] Benchmark a target."); - OUTPUT(" clean-run [] Clean, then run the target."); - OUTPUT(" compile-run [ ...] Compile files then immediately run the result."); - OUTPUT(" compile-only [ ...] Compile files but do not perform linking."); - OUTPUT(" compile-benchmark [ ...] Compile files into an executable and run benchmarks."); - OUTPUT(" compile-test [ ...] Compile files into an executable and run unit tests."); - OUTPUT(" static-lib [ ...] Compile files without a project into a static library."); - OUTPUT(" dynamic-lib [ ...] Compile files without a project into a dynamic library."); - OUTPUT(" headers [ ...] Analyse files and generate C headers for public methods."); - OUTPUT(" vendor-fetch ... Fetches one or more libraries from the vendor collection."); - OUTPUT(""); - OUTPUT("Options:"); - OUTPUT(" --tb - Use Tilde Backend for compilation."); - OUTPUT(" --stdlib - Use this directory as the C3 standard library path."); - OUTPUT(" --no-entry - Do not generate (or require) a main function."); - OUTPUT(" --libdir - Add this directory to the C3 library search paths."); - OUTPUT(" --lib - Add this library to the compilation."); - OUTPUT(" --path - Use this as the base directory for the current command."); - OUTPUT(" --template