lang: ast: initial implementation of class parser
This commit is contained in:
@@ -17,6 +17,13 @@ static enum ivy_status parse_use_keyword(
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status parse_class_keyword(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
parser_push_state(ctx, IVY_AST_CLASS);
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status add_child(
|
||||
struct ivy_ast_node *parent, struct ivy_ast_node *child)
|
||||
{
|
||||
@@ -42,6 +49,7 @@ struct ast_node_type unit_node_ops = {
|
||||
.n_node_size = sizeof(struct ivy_ast_unit_node),
|
||||
.n_keyword_parsers = {
|
||||
[IVY_KW_PACKAGE] = parse_package_keyword,
|
||||
[IVY_KW_CLASS] = parse_class_keyword,
|
||||
[IVY_KW_USE] = parse_use_keyword,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user