lang: ast: implement parsing of inline and standalone if-else statements
This commit is contained in:
@@ -25,7 +25,7 @@ static struct token_parse_result parse_dollar(
|
||||
return PARSE_RESULT(IVY_ERR_BAD_SYNTAX, 0);
|
||||
}
|
||||
|
||||
parser_push_state(ctx, IVY_AST_PROPERTY);
|
||||
parser_push_state(ctx, IVY_AST_PROPERTY, 0);
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ static struct token_parse_result parse_plus(
|
||||
return PARSE_RESULT(IVY_ERR_BAD_SYNTAX, 0);
|
||||
}
|
||||
|
||||
parser_push_state(ctx, IVY_AST_MSGH);
|
||||
parser_push_state(ctx, IVY_AST_MSGH, 0);
|
||||
struct parser_state *msgh_state = parser_get_state_generic(ctx);
|
||||
struct ivy_ast_msgh_node *msgh
|
||||
= (struct ivy_ast_msgh_node *)msgh_state->s_node;
|
||||
@@ -57,7 +57,7 @@ static struct token_parse_result parse_hyphen(
|
||||
return PARSE_RESULT(IVY_ERR_BAD_SYNTAX, 0);
|
||||
}
|
||||
|
||||
parser_push_state(ctx, IVY_AST_MSGH);
|
||||
parser_push_state(ctx, IVY_AST_MSGH, 0);
|
||||
struct parser_state *msgh_state = parser_get_state_generic(ctx);
|
||||
struct ivy_ast_msgh_node *msgh
|
||||
= (struct ivy_ast_msgh_node *)msgh_state->s_node;
|
||||
@@ -150,7 +150,7 @@ static void print(struct ivy_ast_node *node)
|
||||
c->n_ident->t_str);
|
||||
}
|
||||
|
||||
static void init_state(struct ivy_parser *ctx, struct parser_state *sp)
|
||||
static void init_state(struct ivy_parser *ctx, struct parser_state *sp, uintptr_t arg)
|
||||
{
|
||||
struct class_parser_state *state = (struct class_parser_state *)sp;
|
||||
state->s_prev_token = IVY_KW_CLASS;
|
||||
|
||||
Reference in New Issue
Block a user