From 0f3328565eb8fb7caf3dc2cc0ff1c7aab900c17f Mon Sep 17 00:00:00 2001 From: Max Wash Date: Tue, 19 Nov 2024 14:00:42 +0000 Subject: [PATCH] lang: lex: fix identifier prefixed with underscore being tokenised incorrectly --- lang/lex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/lex.c b/lang/lex.c index d2221ca..b16447c 100644 --- a/lang/lex.c +++ b/lang/lex.c @@ -1020,14 +1020,14 @@ static enum ivy_status pump_tokens(struct ivy_lexer *lex) c = peek(lex); } - if (char_can_begin_symbol(c)) { - return read_symbol(lex); - } - if (isalpha(c) || c == '_') { return read_ident(lex); } + if (char_can_begin_symbol(c)) { + return read_symbol(lex); + } + if (isdigit(c)) { return read_number(lex); }