25 lines
547 B
C
25 lines
547 B
C
#include "ast.h"
|
|
|
|
static enum bshell_status collect_children(
|
|
struct ast_node *node,
|
|
struct ast_iterator *it)
|
|
{
|
|
struct if_branch_ast_node *if_branch
|
|
= (struct if_branch_ast_node *)node;
|
|
if (if_branch->n_cond) {
|
|
ast_iterator_enqueue(it, if_branch->n_cond);
|
|
}
|
|
|
|
if (if_branch->n_body) {
|
|
ast_iterator_enqueue(it, if_branch->n_body);
|
|
}
|
|
|
|
return BSHELL_SUCCESS;
|
|
}
|
|
|
|
struct ast_node_definition if_branch_ast_node = {
|
|
.def_id = AST_IF_BRANCH,
|
|
.def_node_size = sizeof(struct if_branch_ast_node),
|
|
.def_collect_children = collect_children,
|
|
};
|