lang: ast: implement more of the expression parser

This commit is contained in:
2024-11-28 17:00:37 +00:00
parent a37e4d23bb
commit b227b27c06
2 changed files with 159 additions and 62 deletions

View File

@@ -35,6 +35,8 @@ enum ivy_ast_node_type {
IVY_AST_COND_GROUP,
IVY_AST_COND,
IVY_AST_TUPLE,
IVY_AST_PKG_INIT,
IVY_AST_PKG_COMPREHENSION,
IVY_AST_TYPE_COUNT,
};
@@ -217,6 +219,19 @@ struct ivy_ast_tuple_node {
b_queue n_members;
};
struct ivy_ast_pkg_init_node {
struct ivy_ast_node n_base;
b_queue n_items;
};
struct ivy_ast_pkg_comprehension_node {
struct ivy_ast_node n_base;
struct ivy_ast_node *n_transform;
struct ivy_ast_node *n_item;
struct ivy_ast_node *n_source;
struct ivy_ast_node *n_cond;
};
struct ivy_ast_block_node {
struct ivy_ast_node n_base;
/* queue of struct ivy_ast_node. expressions to evaluate when the do node itself is evaluated. */