lang: ast: implement control flags returned by parser functions
This commit is contained in:
@@ -18,7 +18,7 @@ struct msgh_parser_state {
|
||||
unsigned int s_prev;
|
||||
};
|
||||
|
||||
static enum ivy_status parse_ident(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
static struct token_parse_result parse_ident(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
struct msgh_parser_state *state
|
||||
= parser_get_state(ctx, struct msgh_parser_state);
|
||||
@@ -28,29 +28,29 @@ static enum ivy_status parse_ident(struct ivy_parser *ctx, struct ivy_token *tok
|
||||
|
||||
if (state->s_current_area == AREA_BODY) {
|
||||
/* TODO expression parsing */
|
||||
return IVY_ERR_NOT_SUPPORTED;
|
||||
return PARSE_RESULT(IVY_ERR_NOT_SUPPORTED, 0);
|
||||
}
|
||||
|
||||
if (state->s_prev == IVY_SYM_HYPHEN) {
|
||||
/* message name */
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
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_msgh_node *msgh = (struct ivy_ast_msgh_node *)parent;
|
||||
|
||||
if (child->n_type == IVY_AST_SELECTOR && !msgh->n_sel) {
|
||||
msgh->n_sel = (struct ivy_ast_selector_node *)child;
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
b_queue_push_back(&msgh->n_body, &child->n_entry);
|
||||
return IVY_OK;
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
static void init_state(struct ivy_parser *ctx, struct parser_state *sp)
|
||||
|
||||
Reference in New Issue
Block a user