lang: lex: fix underscore label producing two separate tokens

This commit is contained in:
2024-11-19 16:17:58 +00:00
parent ea3c01204b
commit a54a232428

View File

@@ -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;