lang: ast: add ast node size to ast_node_type
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <ivy/lang/ast.h>
|
||||
#include "ctx.h"
|
||||
#include "node.h"
|
||||
#include "unit-package.h"
|
||||
@@ -5,8 +6,7 @@
|
||||
static enum ivy_status parse_package_keyword(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
parser_push_state(
|
||||
ctx, IVY_AST_UNIT_PACKAGE, struct ivy_ast_unit_package_node);
|
||||
parser_push_state(ctx, IVY_AST_UNIT_PACKAGE);
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ struct ast_node_type unit_node_ops = {
|
||||
.n_add_child = add_child,
|
||||
.n_print = print,
|
||||
.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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user