lang: ast: implement caret (return) parsing
This commit is contained in:
@@ -24,6 +24,7 @@ extern struct ast_node_type cond_group_node_ops;
|
||||
extern struct ast_node_type cond_node_ops;
|
||||
extern struct ast_node_type match_node_ops;
|
||||
extern struct ast_node_type while_loop_node_ops;
|
||||
extern struct ast_node_type return_node_ops;
|
||||
extern struct ast_node_type discard_node_ops;
|
||||
|
||||
static const struct ast_node_type *node_ops[] = {
|
||||
@@ -46,6 +47,7 @@ static const struct ast_node_type *node_ops[] = {
|
||||
[IVY_AST_COND] = &cond_node_ops,
|
||||
[IVY_AST_MATCH] = &match_node_ops,
|
||||
[IVY_AST_WHILE_LOOP] = &while_loop_node_ops,
|
||||
[IVY_AST_RETURN] = &return_node_ops,
|
||||
[IVY_AST_DISCARD] = &discard_node_ops,
|
||||
};
|
||||
static const size_t nr_node_ops = sizeof node_ops / sizeof node_ops[0];
|
||||
@@ -243,6 +245,7 @@ const char *ivy_ast_node_type_to_string(enum ivy_ast_node_type v)
|
||||
ENUM_STR(IVY_AST_COND);
|
||||
ENUM_STR(IVY_AST_TUPLE);
|
||||
ENUM_STR(IVY_AST_BLOCK);
|
||||
ENUM_STR(IVY_AST_RETURN);
|
||||
ENUM_STR(IVY_AST_TYPE_COUNT);
|
||||
default:
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user