lang: ast: re-write expression parser to support keyword messages
also adjust some parser state callbackss to better support sub-parsers returning results to their parents.
This commit is contained in:
@@ -57,12 +57,6 @@ static struct token_parse_result parse_linefeed(
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
static enum ivy_status add_child(
|
||||
struct ivy_ast_node *parent, struct ivy_ast_node *child)
|
||||
{
|
||||
return IVY_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
static void print(struct ivy_ast_node *node)
|
||||
{
|
||||
struct ivy_ast_unit_package_node *unit_package
|
||||
@@ -94,7 +88,6 @@ static void init_state(struct ivy_parser *ctx, struct parser_state *sp)
|
||||
}
|
||||
|
||||
struct ast_node_type unit_package_node_ops = {
|
||||
.n_add_child = add_child,
|
||||
.n_print = print,
|
||||
.n_init_state = init_state,
|
||||
.n_state_size = sizeof(struct unit_package_parser_state),
|
||||
@@ -107,4 +100,4 @@ struct ast_node_type unit_package_node_ops = {
|
||||
TOK_PARSER(LINEFEED, parse_linefeed),
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user