lang: ast: use fancy index manipulation to reduce the size of ast_node_type

This commit is contained in:
2024-11-28 10:56:43 +00:00
parent f04c858d9a
commit fc76fe6ad4
10 changed files with 80 additions and 64 deletions

View File

@@ -51,8 +51,8 @@ struct ast_node_type unit_node_ops = {
.n_state_size = sizeof(struct parser_state),
.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,
KW_PARSER(PACKAGE, parse_package_keyword),
KW_PARSER(CLASS, parse_class_keyword),
KW_PARSER(USE, parse_use_keyword),
},
};