lang: ast: implement parsing of unnamed parameters

This commit is contained in:
2024-12-07 10:07:20 +00:00
parent 504fea6d9e
commit d404e21b33
2 changed files with 5 additions and 1 deletions

View File

@@ -269,8 +269,10 @@ static void to_string(struct ivy_ast_node *node, b_string *str)
label = b_unbox(struct ivy_token, label_it.entry, t_entry);
name = b_unbox(struct ivy_token, name_it.entry, t_entry);
if (label) {
if (label && label->t_type == IVY_TOK_LABEL) {
b_string_append_cstrf(str, "%s:", label->t_str);
} else {
b_string_append_cstrf(str, "_:");
}
if (name) {