From 655f505485af73a5b82289a10e1ea5727c83dea1 Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Sun, 23 Aug 2026 06:59:24 +0000 Subject: core: Add trace_fatal() macro Signed-off-by: Chloe M. --- core/lexer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/lexer.c') 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 #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; } -- cgit v1.2.3