diff options
| author | 0x221e | 2026-06-15 21:12:35 +0200 |
|---|---|---|
| committer | 0x221e | 2026-06-16 02:19:01 +0200 |
| commit | aab8263f58be6479cc73033a745459849fba7f0a (patch) | |
| tree | 10c1b871c38c8c97a8f70ef20d418ae20d974221 /include | |
| parent | 56796c08d6388ad0eb0539d166cd12964cfeb7e9 (diff) | |
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.
Diffstat (limited to 'include')
| -rw-r--r-- | include/lex.h | 2 | ||||
| -rw-r--r-- | include/platform/osal.h | 1 |
2 files changed, 3 insertions, 0 deletions
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 |
