24 lines
680 B
C
24 lines
680 B
C
#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);
|
|
|
|
fx_queue_entry *entry = fx_queue_first(&match->n_branches);
|
|
while (entry) {
|
|
struct ivy_ast_node *branch
|
|
= 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),
|
|
};
|