Files
ivy/lang/ast/while.c
T

25 lines
575 B
C
Raw Normal View History

#include "iterate.h"
#include "node.h"
2024-12-05 19:29:21 +00:00
#include <ivy/lang/ast.h>
2024-12-05 19:29:21 +00:00
static void collect_children(
struct ivy_ast_node *node, struct ivy_ast_node_iterator *iterator)
{
struct ivy_ast_while_loop_node *loop
= (struct ivy_ast_while_loop_node *)node;
2024-12-05 19:29:21 +00:00
if (loop->n_cond) {
ast_node_iterator_enqueue_node(iterator, node, loop->n_cond);
}
if (loop->n_body) {
ast_node_iterator_enqueue_node(iterator, node, loop->n_body);
}
}
struct ast_node_type while_loop_node_ops = {
.n_collect_children = collect_children,
.n_node_size = sizeof(struct ivy_ast_while_loop_node),
};