lang: ast: define ast_node_type for some fundamental expression components

This commit is contained in:
2024-11-28 22:05:37 +00:00
parent 47c11e4c10
commit 05ced5d5fc
7 changed files with 123 additions and 0 deletions

View File

@@ -13,6 +13,12 @@ extern struct ast_node_type msgh_node_ops;
extern struct ast_node_type selector_node_ops;
extern struct ast_node_type expr_node_ops;
extern struct ast_node_type block_node_ops;
extern struct ast_node_type msg_node_ops;
extern struct ast_node_type op_node_ops;
extern struct ast_node_type ident_node_ops;
extern struct ast_node_type int_node_ops;
extern struct ast_node_type double_node_ops;
extern struct ast_node_type string_node_ops;
static const struct ast_node_type *node_ops[] = {
[IVY_AST_UNIT] = &unit_node_ops,
@@ -23,6 +29,12 @@ static const struct ast_node_type *node_ops[] = {
[IVY_AST_SELECTOR] = &selector_node_ops,
[IVY_AST_EXPR] = &expr_node_ops,
[IVY_AST_BLOCK] = &block_node_ops,
[IVY_AST_MSG] = &msg_node_ops,
[IVY_AST_OP] = &op_node_ops,
[IVY_AST_IDENT] = &ident_node_ops,
[IVY_AST_INT] = &int_node_ops,
[IVY_AST_DOUBLE] = &double_node_ops,
[IVY_AST_STRING] = &string_node_ops,
};
static const size_t nr_node_ops = sizeof node_ops / sizeof node_ops[0];