From c48e032840791e7cec43371e776e989334e54f82 Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Mon, 7 Mar 2022 19:25:14 +0100 Subject: [PATCH] identifier can contain numbers --- src/compiler/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parse.c b/src/compiler/parse.c index 06e9258..a6fc7b5 100644 --- a/src/compiler/parse.c +++ b/src/compiler/parse.c @@ -177,7 +177,7 @@ static Token *tokenize(Source *src, BPAlloc *alloc, Error *error) tok->kind = TIDENT; tok->offset = i; - while(i < len && (isalpha(str[i]) || str[i] == '_')) + while(i < len && (isalpha(str[i]) || isdigit(str[i]) || str[i] == '_')) i += 1; tok->length = i - tok->offset;