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:
@@ -170,24 +170,6 @@ struct ivy_ast_node *ast_node_create(enum ivy_ast_node_type type)
|
||||
return node;
|
||||
}
|
||||
|
||||
enum ivy_status ast_node_add_child(
|
||||
struct ivy_ast_node *parent, struct ivy_ast_node *child)
|
||||
{
|
||||
const struct ast_node_type *ops = get_ast_node_type(parent->n_type);
|
||||
if (!ops) {
|
||||
return IVY_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
enum ivy_status (*add_child)(struct ivy_ast_node *, struct ivy_ast_node *)
|
||||
= ops->n_add_child;
|
||||
|
||||
if (!add_child) {
|
||||
return IVY_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return add_child(parent, child);
|
||||
}
|
||||
|
||||
static enum ivy_status node_print(
|
||||
struct ivy_ast_node *node, struct ivy_ast_node_iterator *it)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user