diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-07-21 20:48:01 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-15 10:04:32 +0900 |
| commit | 0c9dc7318361c93e837c8f4bc5c29869076c36cd (patch) | |
| tree | a0998f947324fb42885338d0bd729d02d4309f40 /tokenize.c | |
| parent | 1c48d0fe728c263bbe946a5d3adebaa29323ddff (diff) | |
| download | ducc-0c9dc7318361c93e837c8f4bc5c29869076c36cd.tar.gz ducc-0c9dc7318361c93e837c8f4bc5c29869076c36cd.tar.zst ducc-0c9dc7318361c93e837c8f4bc5c29869076c36cd.zip | |
feat: implement va_*() functions
Diffstat (limited to 'tokenize.c')
| -rw-r--r-- | tokenize.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -53,6 +53,9 @@ enum TokenKind { TokenKind_semicolon, TokenKind_slash, TokenKind_star, + + // va_start() is currently implemented as a special form due to the current limitation of #define macro. + TokenKind_va_start, }; typedef enum TokenKind TokenKind; @@ -169,6 +172,8 @@ const char* token_kind_stringify(TokenKind k) { return "/"; else if (k == TokenKind_star) return "*"; + else if (k == TokenKind_va_start) + return "va_start"; else unreachable(); } @@ -247,6 +252,8 @@ void tokenize_all(Lexer* l) { tok->kind = TokenKind_keyword_void; } else if (string_equals_cstr(&pp_tok->raw, "while")) { tok->kind = TokenKind_keyword_while; + } else if (string_equals_cstr(&pp_tok->raw, "va_start")) { + tok->kind = TokenKind_va_start; } else { tok->kind = TokenKind_ident; } |
