From c7d0deda9effcc38294caba28640b86c835c8976 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 5 May 2025 16:30:53 +0900 Subject: support identifiers that start with underscore --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index bb91a3b..8db2f31 100644 --- a/main.c +++ b/main.c @@ -214,7 +214,7 @@ struct Token* tokenize(char* src) { tok->kind = TK_L_INT; tok->value = calloc(pos - start + 1, sizeof(char)); memcpy(tok->value, src + start, pos - start); - } else if (isalpha(c)) { + } else if (isalpha(c) || c == '_') { pos -= 1; start = pos; while (isalnum(src[pos]) || src[pos] == '_') { -- cgit v1.2.3-70-g09d2