summaryrefslogtreecommitdiff
path: root/core/lexer.c
diff options
context:
space:
mode:
authorChloe M. <chloe@aptel.org>2026-08-23 06:59:24 +0000
committerChloe M. <chloe@aptel.org>2026-08-23 06:59:24 +0000
commit655f505485af73a5b82289a10e1ea5727c83dea1 (patch)
tree89792b8550391cf65b93ba23fe3b42d2690628bd /core/lexer.c
parent9bf5da82de7c19360c291d990814128a7b86c92e (diff)
core: Add trace_fatal() macro
Signed-off-by: Chloe M. <chloe@aptel.org>
Diffstat (limited to 'core/lexer.c')
-rw-r--r--core/lexer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/lexer.c b/core/lexer.c
index 72aa942..ac5194f 100644
--- a/core/lexer.c
+++ b/core/lexer.c
@@ -9,6 +9,7 @@
#include <string.h>
#include "defconf/lexer.h"
#include "defconf/ptrbox.h"
+#include "defconf/trace.h"
/* Constants */
#define MAX_KW_LEN 32
@@ -107,7 +108,7 @@ lexer_scan_ident(struct defconf_state *state, int lc)
buf[bufind++] = lc;
for (;;) {
if (bufind >= sizeof(buf) - 1) {
- printf("fatal: token exceeds maximum length\n");
+ trace_fatal(state, "token exceeds maximum length\n");
return NULL;
}
@@ -191,6 +192,6 @@ lexer_scan(struct defconf_state *state, struct token *result)
return 0;
}
- printf("fatal: unexpected token '%c'\n", c);
+ trace_fatal(state, "unexpected token '%c'\n", c);
return -1;
}