24 lines
565 B
C
24 lines
565 B
C
#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)
|
|
{
|
|
struct ivy_ast_global_node *global = (struct ivy_ast_global_node *)node;
|
|
|
|
if (global->n_left) {
|
|
ast_node_iterator_enqueue_node(iterator, node, global->n_left);
|
|
}
|
|
|
|
if (global->n_val) {
|
|
ast_node_iterator_enqueue_node(iterator, node, global->n_val);
|
|
}
|
|
}
|
|
|
|
struct ast_node_type global_node_ops = {
|
|
.n_collect_children = collect_children,
|
|
.n_node_size = sizeof(struct ivy_ast_global_node),
|
|
};
|