lang: ast: convert RPN expression queue to ast and replace generic EXPR node with it
This commit is contained in:
@@ -146,18 +146,21 @@ token_parse_function get_token_parser(
|
||||
return better_parser ? better_parser : generic_parser;
|
||||
}
|
||||
|
||||
struct ivy_ast_node *ast_node_create_with_size(
|
||||
enum ivy_ast_node_type type, size_t size)
|
||||
struct ivy_ast_node *ast_node_create(enum ivy_ast_node_type type)
|
||||
{
|
||||
struct ivy_ast_node *node = malloc(size);
|
||||
const struct ast_node_type *type_info = get_ast_node_type(type);
|
||||
if (!type_info) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct ivy_ast_node *node = malloc(type_info->n_node_size);
|
||||
if (!node) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(node, 0x0, size);
|
||||
memset(node, 0x0, type_info->n_node_size);
|
||||
|
||||
node->n_type = type;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user