Files
ivy/lang/ast/unit.c
T

23 lines
621 B
C
Raw Normal View History

2024-11-24 20:50:12 +00:00
#include "iterate.h"
#include "node.h"
#include <ivy/lang/ast.h>
static void collect_children(
struct ivy_ast_node *node, struct ivy_ast_node_iterator *iterator)
{
2024-11-24 20:50:12 +00:00
struct ivy_ast_unit_node *unit = (struct ivy_ast_unit_node *)node;
2026-03-16 14:07:33 +00:00
fx_queue_entry *entry = fx_queue_first(&unit->n_children);
2025-11-06 10:38:32 +00:00
while (entry) {
struct ivy_ast_node *child
2026-03-16 14:07:33 +00:00
= fx_unbox(struct ivy_ast_node, entry, n_entry);
2024-11-24 20:50:12 +00:00
ast_node_iterator_enqueue_node(iterator, node, child);
2026-03-16 14:07:33 +00:00
entry = fx_queue_next(entry);
2024-11-24 20:50:12 +00:00
}
}
struct ast_node_type unit_node_ops = {
2024-11-24 20:50:12 +00:00
.n_collect_children = collect_children,
.n_node_size = sizeof(struct ivy_ast_unit_node),
};