From 1fd88c646d59cdb18fe5a99024953693a85441e2 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Tue, 24 Mar 2026 22:48:45 +0100 Subject: [PATCH] chore: remove whitespaces --- cmeta.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cmeta.h b/cmeta.h index 96adf70..3ec5ee7 100644 --- a/cmeta.h +++ b/cmeta.h @@ -17,7 +17,6 @@ typedef struct { // AUTO GENERATED CODE // // AUTO GENERATED CODE // -// #define CMETA_COMPTIME #ifdef CMETA_COMPTIME #include @@ -101,7 +100,7 @@ bool lexer_expect_keyword(const char* expected) { if (lexer.token != CLEX_id) { // TODO: map lexer.token to readable name fprintf(stderr, "ERROR: expected `%s` but got `%ld`\n", expected, lexer.token); - return false; + return false; } if (strcmp(lexer.string, expected) != 0) { @@ -122,7 +121,7 @@ bool lexer_expect(long expected, const char* expected_str) { } else { fprintf(stderr, "ERROR: expected `%ld` but got `%ld`\n", expected, lexer.token); } - return false; + return false; } return true; @@ -256,7 +255,7 @@ void generate_struct_info(FILE* stream, Parsed_Struct_Info info) { } gen(" },"); gen("};"); - + free(lowercase_name); } @@ -266,7 +265,7 @@ bool read_entire_file(const char* file_path, char** content) { if(file == NULL) goto fail; if(fseek(file, 0, SEEK_END) < 0) goto fail; - + long length = ftell(file); if(length < 0) goto fail; @@ -295,7 +294,7 @@ bool generate_output_file(const char* output_path, Parsed_Struct_Infos struct_in const size_t GENERATION_MARK_LEN = strlen(GENERATION_MARK); bool result = false; - + char* header_content; if (!read_entire_file(__FILE__, &header_content)) goto fail; @@ -365,6 +364,8 @@ bool preprocess_file(const char* file_path, String_Builder* result) { collecting_content = true; continue; } + + // TODO: read original file at line_num, to check for comments (e.g annotations) } else if(collecting_content) { sb_append(result, line); cursor += strlen(line); @@ -397,9 +398,9 @@ bool process_file(const char* input_file) { Parsed_Struct_Info struct_info = {0}; if (parse_struct(&struct_info)) { - da_append(&struct_infos, struct_info); + da_append(&struct_infos, struct_info); } - } + } } if (!generate_output_file(__FILE__, struct_infos)) return false; @@ -409,4 +410,4 @@ bool process_file(const char* input_file) { #endif // CMETA_COMPTIME -#endif // CMETA_H \ No newline at end of file +#endif // CMETA_H