diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-05-05 16:30:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-05-05 16:30:53 +0900 |
| commit | c7d0deda9effcc38294caba28640b86c835c8976 (patch) | |
| tree | ef1599193900f22f80eb1e476c9ef6b5ef07b8b4 /main.c | |
| parent | 0cd91dec317281f8eb299fff7fed725e59f78d42 (diff) | |
| download | P4Dcc-c7d0deda9effcc38294caba28640b86c835c8976.tar.gz P4Dcc-c7d0deda9effcc38294caba28640b86c835c8976.tar.zst P4Dcc-c7d0deda9effcc38294caba28640b86c835c8976.zip | |
support identifiers that start with underscore
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] == '_') { |
