27 lines
576 B
C
27 lines
576 B
C
#include "../parse/token.h"
|
|
#include "ast.h"
|
|
|
|
static enum bshell_status collect_children(
|
|
struct ast_node *node,
|
|
struct ast_iterator *it)
|
|
{
|
|
struct hashtable_item_ast_node *item
|
|
= (struct hashtable_item_ast_node *)node;
|
|
|
|
if (item->n_key) {
|
|
ast_iterator_enqueue(it, item->n_key);
|
|
}
|
|
|
|
if (item->n_value) {
|
|
ast_iterator_enqueue(it, item->n_value);
|
|
}
|
|
|
|
return BSHELL_SUCCESS;
|
|
}
|
|
|
|
struct ast_node_definition hashtable_item_ast_node = {
|
|
.def_id = AST_HASHTABLE_ITEM,
|
|
.def_node_size = sizeof(struct hashtable_item_ast_node),
|
|
.def_collect_children = collect_children,
|
|
};
|