cleanup mess

This commit is contained in:
sam 2024-07-22 23:38:34 +12:00
parent 5f1f937270
commit c8a6f86705

View file

@ -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);