lang: ast: implement parsing 'use' statements
This commit is contained in:
@@ -10,6 +10,13 @@ static enum ivy_status parse_package_keyword(
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status parse_use_keyword(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
parser_push_state(ctx, IVY_AST_UNIT_IMPORT);
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
static enum ivy_status add_child(
|
||||
struct ivy_ast_node *parent, struct ivy_ast_node *child)
|
||||
{
|
||||
@@ -35,5 +42,6 @@ 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_USE] = parse_use_keyword,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user