42sh/src/utils/ast/ast.c

16 lines
258 B
C
Raw Normal View History

#include "ast.h"
#include <stdbool.h>
static struct ast *ast_create(enum ast_type type, void *data)
{
struct ast *node = malloc(sizeof(struct ast));
if (!node)
return NULL;
node->type = type;
node->data = data;
return node;
}