From a54a23242837305bb4d189ab3b74e3026f8d648e Mon Sep 17 00:00:00 2001 From: Max Wash Date: Tue, 19 Nov 2024 16:17:58 +0000 Subject: [PATCH] lang: lex: fix underscore label producing two separate tokens --- lang/lex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/lex.c b/lang/lex.c index d764710..bf460ce 100644 --- a/lang/lex.c +++ b/lang/lex.c @@ -890,8 +890,8 @@ static enum ivy_status read_ident(struct ivy_lexer *lex) } const char *s = b_string_ptr(str); - if (!strcmp(s, "_")) { - push_symbol(lex, IVY_SYM_UNDERSCORE); + if (!label && !strcmp(s, "_")) { + return push_symbol(lex, IVY_SYM_UNDERSCORE); } enum ivy_keyword keyword = IVY_KW_NONE;