From c8a6f8670591bc573e4afc5028e7ab253091c75c Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 22 Jul 2024 23:38:34 +1200 Subject: [PATCH] cleanup mess --- src/main.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main.c b/src/main.c index 14b61f5..403289e 100644 --- a/src/main.c +++ b/src/main.c @@ -15,20 +15,26 @@ int main(int argc, char* argv[]) { char* input = sl_c_str(*input_str); int debug = args.comp_debug; - if(debug) printf("Tokens:\n"); TokenVec tokens = { 0 }; tokenize(input, &tokens); - if(debug) tokens_print(tokens); - if(debug) printf("\n"); + if(debug) { + printf("Tokens:\n"); + tokens_print(tokens); + printf("\n"); + } - if(debug) printf("AST:\n"); ASTNode* program = ast_parse(&tokens); - if(debug) ast_print(program, 0); - if(debug) printf("\n"); + if(debug) { + printf("AST:\n"); + ast_print(program, 0); + printf("\n"); + } - if(debug) printf("Codegen:\n"); const char* code = codegen(program); - if(debug) printf("%s\n\n", code); + if(debug) { + printf("Codegen:\n"); + printf("%s\n\n", code); + } binary_produce(code, args);