identifier can contain numbers

This commit is contained in:
Francesco Cozzuto
2022-03-07 19:25:14 +01:00
parent 4c779e9e8b
commit c48e032840
+1 -1
View File
@@ -177,7 +177,7 @@ static Token *tokenize(Source *src, BPAlloc *alloc, Error *error)
tok->kind = TIDENT; tok->kind = TIDENT;
tok->offset = i; tok->offset = i;
while(i < len && (isalpha(str[i]) || str[i] == '_')) while(i < len && (isalpha(str[i]) || isdigit(str[i]) || str[i] == '_'))
i += 1; i += 1;
tok->length = i - tok->offset; tok->length = i - tok->offset;