implement parsing #3

Merged
omicron merged 15 commits from parser_start into main 2025-04-02 19:53:48 +00:00
3 changed files with 6 additions and 3 deletions
Showing only changes of commit 42da7b1d05 - Show all commits

View File

@ -10,6 +10,9 @@ error_t *const err_errorf_length = &(error_t){
.message =
"Formatting of another error failed to determine the error length"};
error_t *err_allocation_failed =
&(error_t){.message = "Memory allocation failed"};
error_t *errorf(const char *fmt, ...) {
error_t *err = calloc(1, sizeof(error_t));
if (err == nullptr)

View File

@ -18,4 +18,7 @@ static inline void error_free(error_t *err) {
free(err);
}
/* Some global errors */
extern error_t *err_allocation_failed;
#endif // INCLUDE_SRC_ERROR_H_

View File

@ -20,9 +20,6 @@ error_t *err_eof =
error_t *err_unknown_read = &(error_t){.message = "Unknown read error"};
error_t *err_allocation_failed =
&(error_t){.message = "Memory allocation failed"};
typedef bool (*char_predicate_t)(char);
const char *lexer_token_id_to_cstr(lexer_token_id_t id) {