diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2024-09-26 17:10:00 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2024-09-26 17:10:00 +0330 |
commit | 2ce72027e79a5aba03ecb4180039cd874b230c7a (patch) | |
tree | f9a99c4d241a69405a21c4212796276fda75edcb /src/compiler/error_helper/error_helper.c | |
parent | 3b5df1794867ccffc56ac5633af6c77a0b3952c8 (diff) |
some small improvement
added \h in string (which can use hex as character)
Diffstat (limited to 'src/compiler/error_helper/error_helper.c')
-rw-r--r-- | src/compiler/error_helper/error_helper.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/error_helper/error_helper.c b/src/compiler/error_helper/error_helper.c index 42e3745..e307c91 100644 --- a/src/compiler/error_helper/error_helper.c +++ b/src/compiler/error_helper/error_helper.c @@ -16,12 +16,13 @@ void printError(char const *error, SourceCode *sourceCode, char const *begin, for (size_t i = 0; i < sourceCode->size; ++i) { const Code *source = sourceCode->codes[i]; - if (source->code <= begin && strlen(source->code)+source->code >= end) { + if (source->code <= begin && strlen(source->code) + source->code >= end) { code = source; } } if (code == NULL) { - fprintf(stderr, "Bad Error: the error is in no source code\n"); + fprintf(stderr, + "Compiler Internal Error: the error is in no source code\n"); return; } @@ -33,9 +34,7 @@ void printError(char const *error, SourceCode *sourceCode, char const *begin, const char c = *iter; switch (c) { case '\0': - fprintf(stderr, - "Compiler Internal Error: in printing errors at compiler %s:%d", - __FILE_NAME__, __LINE__); + fprintf(stderr, "Compiler Internal Error: in printing errors\n"); exit(1); case '\n': lineBegin = iter + 1; |