lang: update bluelib api usage

This commit is contained in:
2025-11-06 10:38:32 +00:00
parent b26c37c349
commit 4386965cd9
40 changed files with 351 additions and 271 deletions

View File

@@ -2,7 +2,7 @@
#include "ivy/status.h"
#include "node.h"
#include <blue/object/string.h>
#include <blue/ds/string.h>
#include <ivy/lang/lex.h>
#include <stdio.h>
@@ -252,22 +252,19 @@ static void to_string(struct ivy_ast_node *node, b_string *str)
b_string_append_cstr(str, "(");
}
b_queue_iterator label_it = {0};
b_queue_iterator name_it = {0};
b_queue_iterator_begin(&sel->n_arg_labels, &label_it);
b_queue_iterator_begin(&sel->n_arg_names, &name_it);
b_queue_entry *label_entry = b_queue_first(&sel->n_arg_labels);
b_queue_entry *name_entry = b_queue_first(&sel->n_arg_names);
int i = 0;
while (b_queue_iterator_is_valid(&label_it)) {
while (label_entry) {
if (i > 0) {
b_string_append_cstr(str, " ");
}
struct ivy_token *label, *name;
label = b_unbox(struct ivy_token, label_it.entry, t_entry);
name = b_unbox(struct ivy_token, name_it.entry, t_entry);
label = b_unbox(struct ivy_token, label_entry, t_entry);
name = b_unbox(struct ivy_token, name_entry, t_entry);
if (label && label->t_type == IVY_TOK_LABEL && label->t_str) {
b_string_append_cstrf(str, "%s:", label->t_str);
@@ -283,8 +280,8 @@ static void to_string(struct ivy_ast_node *node, b_string *str)
i++;
}
b_queue_iterator_next(&label_it);
b_queue_iterator_next(&name_it);
label_entry = b_queue_next(label_entry);
name_entry = b_queue_next(name_entry);
}
if (sel->n_msg_name && !b_queue_empty(&sel->n_arg_labels)) {