Files
ivy/lang/ast/match.c
T

24 lines
680 B
C
Raw Normal View History

#include "iterate.h"
#include "node.h"
static void match_collect_children(
struct ivy_ast_node *node, struct ivy_ast_node_iterator *iterator)
{
struct ivy_ast_match_node *match = (struct ivy_ast_match_node *)node;
ast_node_iterator_enqueue_node(iterator, node, match->n_cond);
2026-03-16 14:07:33 +00:00
fx_queue_entry *entry = fx_queue_first(&match->n_branches);
2025-11-06 10:38:32 +00:00
while (entry) {
struct ivy_ast_node *branch
2026-03-16 14:07:33 +00:00
= fx_unbox(struct ivy_ast_node, entry, n_entry);
ast_node_iterator_enqueue_node(iterator, node, branch);
entry = fx_queue_next(entry);
}
}
struct ast_node_type match_node_ops = {
.n_collect_children = match_collect_children,
.n_node_size = sizeof(struct ivy_ast_match_node),
};