lang: ast: implement parsing of match statements
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "block.h"
|
||||
#include "iterate.h"
|
||||
#include "expr/expr.h"
|
||||
|
||||
struct cond_group_parser_state {
|
||||
@@ -72,7 +73,7 @@ static enum ivy_status flush_current_branch(struct cond_group_parser_state *stat
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
struct token_parse_result parse_then(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
static struct token_parse_result parse_then(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
struct cond_group_parser_state *state
|
||||
= parser_get_state(ctx, struct cond_group_parser_state);
|
||||
@@ -108,7 +109,7 @@ struct token_parse_result parse_then(struct ivy_parser *ctx, struct ivy_token *t
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
struct token_parse_result parse_else(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
static struct token_parse_result parse_else(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
enum ivy_status status;
|
||||
struct cond_group_parser_state *state
|
||||
@@ -167,7 +168,7 @@ struct token_parse_result parse_else(struct ivy_parser *ctx, struct ivy_token *t
|
||||
return PARSE_RESULT(IVY_OK, 0);
|
||||
}
|
||||
|
||||
struct token_parse_result parse_expr_begin(struct ivy_parser* ctx, struct ivy_token* tok)
|
||||
static struct token_parse_result parse_expr_begin(struct ivy_parser* ctx, struct ivy_token* tok)
|
||||
{
|
||||
struct cond_group_parser_state *state
|
||||
= parser_get_state(ctx, struct cond_group_parser_state);
|
||||
@@ -235,7 +236,7 @@ static enum ivy_status finalise_cond_group(struct cond_group_parser_state* state
|
||||
}
|
||||
}
|
||||
|
||||
struct token_parse_result parse_punct_terminator(
|
||||
static struct token_parse_result parse_punct_terminator(
|
||||
struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
struct cond_group_parser_state *state
|
||||
@@ -255,7 +256,7 @@ struct token_parse_result parse_punct_terminator(
|
||||
return PARSE_RESULT(IVY_OK, PARSE_REPEAT_TOKEN);
|
||||
}
|
||||
|
||||
struct token_parse_result parse_end(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
static struct token_parse_result parse_end(struct ivy_parser *ctx, struct ivy_token *tok)
|
||||
{
|
||||
struct cond_group_parser_state *state
|
||||
= parser_get_state(ctx, struct cond_group_parser_state);
|
||||
|
||||
Reference in New Issue
Block a user