|
libpulsar
A modular compiler for the pulsar programming language
|
Error reporting and displaying utilities. More...
#include <stdio.h>#include "def.h"#include "enum/make.h"#include "frontend/lexer/loc.h"#include "error_scope.h"#include "error_codes.h"Go to the source code of this file.
Data Structures | |
| struct | ps_error |
| Represents an error or source-referencing display message. More... | |
Macros | |
| #define | PS_MAX_ERRORS 128 |
| #define | ENUM TO_ENUM |
| #define | ENUM TO_ENUM |
| #define | ps_print_errors() ps_fprint_errors(stderr) |
Enumerations | |
| enum | ps_error_scope { PS_NUM_OF_ESCOPES } |
| THe domain of error that occured. More... | |
| enum | ps_error_code { PS_NUM_OF_ECODES } |
| The type of error that occured. More... | |
Functions | |
| void | ps_error (enum ps_error_scope scope, short code, const char *file_source, struct ps_loc loc, usize length, const char *message, const char *explain, const char *fix) |
Reports an error with the given domain scope and error code code to the error reporting system. | |
| void | ps_fprint_errors (FILE *stream) |
Prints all errors in the error-reporting system to the given output stream stream. | |
| usize | ps_error_count (void) |
| The number of errors that have been reported in the error reporting system. | |
Error reporting and displaying utilities.
Definition in file error.h.
| #define ps_print_errors | ( | ) | ps_fprint_errors(stderr) |
| enum ps_error_code |
| enum ps_error_scope |
| void ps_error | ( | enum ps_error_scope | scope, |
| short | code, | ||
| const char * | file_source, | ||
| struct ps_loc | loc, | ||
| usize | length, | ||
| const char * | message, | ||
| const char * | explain, | ||
| const char * | fix | ||
| ) |
Reports an error with the given domain scope and error code code to the error reporting system.
file_source, loc and length of the error so that the output is formatted nicely.message describes the content of the error.explain provides further information on why the error occured.fix suggest ways to amend the error. You may redefine these semantics in from the user perspective as desired, but they will always be formatted the same way. | usize ps_error_count | ( | void | ) |