|
Luma 0.1.0
A low-level compiled alternative to C, C++, and more!
|
Implementation of error reporting and diagnostics functions. More...
#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../../lexer/lexer.h"#include "../color/color.h"#include "../memory/memory.h"#include "error.h"
Macros | |
| #define | MAX_ERRORS 256 |
Functions | |
| const char * | generate_line (ArenaAllocator *arena, Token *tokens, int token_count, int target_line) |
| Generates the full source line text for a given line number. | |
| void | error_add (ErrorInformation err) |
| Adds an error to the internal error list. | |
| void | error_clear (void) |
| Clears all accumulated errors from the error list. | |
| bool | error_report (void) |
| Reports all accumulated errors with formatting. | |
| int | error_get_count (void) |
| Gets the current error count. | |
| bool | error_has_errors (void) |
| Checks if there are any errors. | |
| ErrorInformation * | error_get_at_index (int index) |
| Gets the error at the specified index. | |
Implementation of error reporting and diagnostics functions.
This module manages an internal list of errors, supports generating source line context from tokens, and prints detailed error reports with color highlighting.
| #define MAX_ERRORS 256 |
| void error_add | ( | ErrorInformation | err | ) |
Adds an error to the internal error list.
Adds a new error to the internal error list.
| void error_clear | ( | void | ) |
Clears all accumulated errors from the error list.
Clears all accumulated errors.
| ErrorInformation * error_get_at_index | ( | int | index | ) |
Gets the error at the specified index.
| index | Index of the error to retrieve (0-based). |
| int error_get_count | ( | void | ) |
Gets the current error count.
| bool error_has_errors | ( | void | ) |
Checks if there are any errors.
| bool error_report | ( | void | ) |
Reports all accumulated errors with formatting.
Reports all accumulated errors to stderr or appropriate output.
| const char * generate_line | ( | ArenaAllocator * | arena, |
| Token * | tokens, | ||
| int | token_count, | ||
| int | target_line | ||
| ) |
Generates the full source line text for a given line number.
Generates the source code line text for a given line number.