Files
ivy/lang/ast/tuple.c
T

27 lines
694 B
C
Raw Normal View History

2024-12-08 12:28:47 +00:00
#include "iterate.h"
#include "ivy/status.h"
#include "node.h"
2026-03-16 14:07:33 +00:00
#include <fx/ds/string.h>
2024-12-08 12:28:47 +00:00
#include <ivy/lang/lex.h>
#include <stdio.h>
static void collect_children(
struct ivy_ast_node *node, struct ivy_ast_node_iterator *iterator)
{
struct ivy_ast_tuple_node *tuple = (struct ivy_ast_tuple_node *)node;
2026-03-16 14:07:33 +00:00
fx_queue_entry *entry = fx_queue_first(&tuple->n_members);
2025-11-06 10:38:32 +00:00
while (entry) {
2025-09-08 16:01:02 +01:00
struct ivy_ast_node *item
2026-03-16 14:07:33 +00:00
= fx_unbox(struct ivy_ast_node, entry, n_entry);
2024-12-08 12:28:47 +00:00
ast_node_iterator_enqueue_node(iterator, node, item);
2026-03-16 14:07:33 +00:00
entry = fx_queue_next(entry);
2024-12-08 12:28:47 +00:00
}
}
struct ast_node_type tuple_node_ops = {
.n_collect_children = collect_children,
.n_node_size = sizeof(struct ivy_ast_tuple_node),
};