lang: ast: implement control flags returned by parser functions
This commit is contained in:
@@ -3,33 +3,33 @@
|
||||
#include "node.h"
|
||||
#include "iterate.h"
|
||||
|
||||
static enum ivy_status parse_package_keyword(
|
||||
static struct token_parse_result parse_package_keyword(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
parser_push_state(ctx, IVY_AST_UNIT_PACKAGE);
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
static enum ivy_status parse_use_keyword(
|
||||
static struct token_parse_result parse_use_keyword(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
parser_push_state(ctx, IVY_AST_UNIT_IMPORT);
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
static enum ivy_status parse_class_keyword(
|
||||
static struct token_parse_result parse_class_keyword(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
parser_push_state(ctx, IVY_AST_CLASS);
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
static enum ivy_status add_child(
|
||||
static struct token_parse_result add_child(
|
||||
struct ivy_ast_node *parent, struct ivy_ast_node *child)
|
||||
{
|
||||
struct ivy_ast_unit_node *unit = (struct ivy_ast_unit_node *)parent;
|
||||
b_queue_push_back(&unit->n_children, &child->n_entry);
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
static void collect_children(struct ivy_ast_node *node, struct ivy_ast_node_iterator *iterator)
|
||||
|
||||
Reference in New Issue
Block a user