cleanup mess
This commit is contained in:
parent
5f1f937270
commit
c8a6f86705
1 changed files with 14 additions and 8 deletions
22
src/main.c
22
src/main.c
|
@ -15,20 +15,26 @@ int main(int argc, char* argv[]) {
|
||||||
char* input = sl_c_str(*input_str);
|
char* input = sl_c_str(*input_str);
|
||||||
|
|
||||||
int debug = args.comp_debug;
|
int debug = args.comp_debug;
|
||||||
if(debug) printf("Tokens:\n");
|
|
||||||
TokenVec tokens = { 0 };
|
TokenVec tokens = { 0 };
|
||||||
tokenize(input, &tokens);
|
tokenize(input, &tokens);
|
||||||
if(debug) tokens_print(tokens);
|
if(debug) {
|
||||||
if(debug) printf("\n");
|
printf("Tokens:\n");
|
||||||
|
tokens_print(tokens);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if(debug) printf("AST:\n");
|
|
||||||
ASTNode* program = ast_parse(&tokens);
|
ASTNode* program = ast_parse(&tokens);
|
||||||
if(debug) ast_print(program, 0);
|
if(debug) {
|
||||||
if(debug) printf("\n");
|
printf("AST:\n");
|
||||||
|
ast_print(program, 0);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if(debug) printf("Codegen:\n");
|
|
||||||
const char* code = codegen(program);
|
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);
|
binary_produce(code, args);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue