From 7ca8f2c6445a902c681f4b871d15e0eda3724895 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 31 Oct 2023 20:39:49 +0000 Subject: asm/main logs are now indented and look prettier --- asm/main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'asm/main.c') diff --git a/asm/main.c b/asm/main.c index bfa12e0..07117ac 100644 --- a/asm/main.c +++ b/asm/main.c @@ -35,8 +35,13 @@ int main(int argc, char *argv[]) return 1; } - source_file = argv[1]; - out_file = argv[2]; + source_file = argv[1]; + out_file = argv[2]; + +#if VERBOSE >= 1 + printf("[%sASSEMBLER%s]: Assembling `%s` to `%s`\n", TERM_YELLOW, TERM_RESET, + source_file, out_file); +#endif FILE *fp = fopen(source_file, "rb"); darr_t buffer = darr_read_file(fp); fclose(fp); @@ -63,7 +68,7 @@ int main(int argc, char *argv[]) goto end; } #if VERBOSE >= 1 - printf("[%sTOKENISER%s]: %lu bytes -> %lu tokens\n", TERM_GREEN, TERM_RESET, + printf("\t[%sTOKENISER%s]: %lu bytes -> %lu tokens\n", TERM_GREEN, TERM_RESET, buffer.used, tokens.available); #endif free(buffer.data); @@ -87,7 +92,7 @@ int main(int argc, char *argv[]) goto end; } #if VERBOSE >= 1 - printf("[%sPARSER%s]: %lu tokens -> %lu instructions\n", TERM_GREEN, + printf("\t[%sPARSER%s]: %lu tokens -> %lu instructions\n", TERM_GREEN, TERM_RESET, tokens.available, number); #endif @@ -95,7 +100,7 @@ int main(int argc, char *argv[]) insts_write_bytecode_file(instructions, number, fp); fclose(fp); #if VERBOSE >= 1 - printf("[%sCOMPILER%s]: Wrote bytecode to `%s`\n", TERM_GREEN, TERM_RESET, + printf("[%sASSEMBLER%s]: Wrote bytecode to `%s`\n", TERM_GREEN, TERM_RESET, out_file); #endif end: -- cgit v1.2.3-13-gbd6f