diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-04-24 19:20:06 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-04-24 19:20:06 +0330 |
commit | cfc289f11c09aad28482204255934742e0f3f87f (patch) | |
tree | 0d388fad87380f8772497d85579404a5bf1f9168 /src/utils | |
parent | 79babd7e6c97ead76c7cd6295f01e049d1b28524 (diff) |
fix space checking in lexer
some small improvements
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/log.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/log.c b/src/utils/log.c index e8eb047..898517d 100644 --- a/src/utils/log.c +++ b/src/utils/log.c @@ -33,13 +33,13 @@ void _printErrorWarningBack(const char *file, int line, char *begin, char *end, } } - const char firstColor[] = "\e[0;36m"; + static const char FIRST_COLOR[] = "\e[0;36m"; const char *secondColor = isError ? "\e[0;31m" : "\e[0;33m"; if (isError) { - fprintf(stderr, "%sError: %s at compiler %s:%d\e[0m\n", firstColor, + fprintf(stderr, "%sError: %s at compiler %s:%d\e[0m\n", FIRST_COLOR, errorStr, file, line); } else { - fprintf(stderr, "%sWarning: %s at compiler %s:%d\e[0m\n", firstColor, + fprintf(stderr, "%sWarning: %s at compiler %s:%d\e[0m\n", FIRST_COLOR, errorStr, file, line); } free(errorStr); @@ -65,14 +65,14 @@ void _printErrorWarningBack(const char *file, int line, char *begin, char *end, } } - fprintf(stderr, "\e%sAt %s:%ld\n", firstColor, fileCodes_names[file_index], + fprintf(stderr, "\e%sAt %s:%ld\n", FIRST_COLOR, fileCodes_names[file_index], file_line); for (char *iter = file_line_begin; iter < file_line_end; ++iter) { if (iter == begin) { fprintf(stderr, "%s", secondColor); } else if (iter == end) { - fprintf(stderr, "%s", firstColor); + fprintf(stderr, "%s", FIRST_COLOR); } fprintf(stderr, "%c", *iter); } |