From aab8263f58be6479cc73033a745459849fba7f0a Mon Sep 17 00:00:00 2001 From: 0x221e Date: Mon, 15 Jun 2026 21:12:35 +0200 Subject: lex: add lex_get_token_name() Add lex_get_token_name() to lex/lex.c and refactor platform/elf/main.c so that it prints the token identifier string rather than int. --- include/lex.h | 2 ++ include/platform/osal.h | 1 + 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/lex.h b/include/lex.h index a712204..4b8b1ac 100644 --- a/include/lex.h +++ b/include/lex.h @@ -31,6 +31,8 @@ #define TOKEN_STAR 23 #define TOKEN_SLASH 24 +const char* lex_get_token_name(int id); + struct token { int type; // size_t line; diff --git a/include/platform/osal.h b/include/platform/osal.h index 8eee16b..b6a35d9 100644 --- a/include/platform/osal.h +++ b/include/platform/osal.h @@ -19,5 +19,6 @@ struct file { struct file open_file(const char *path, int flags); void print(const char *fmt, ...); +void exitc(int c); #endif -- cgit v1.2.3