lang: ast: implement parsing of try-catch-finally statements

This commit is contained in:
2025-01-16 13:15:48 +00:00
parent 143d61e329
commit 46d244a28d
6 changed files with 352 additions and 10 deletions

View File

@@ -92,8 +92,10 @@ struct expr_parser_state {
/* general functions */
extern void expr_add_terminator(struct expr_parser_state *state, unsigned short tok);
extern void expr_copy_terminators(const struct expr_parser_state *src, struct expr_parser_state *dest);
extern bool expr_terminates_at_token(struct expr_parser_state *state, unsigned short tok);
extern void expr_copy_terminators(
const struct expr_parser_state *src, struct expr_parser_state *dest);
extern bool expr_terminates_at_token(
struct expr_parser_state *state, unsigned short tok);
extern struct token_parse_result expr_finalise(
struct ivy_parser *ctx, struct expr_parser_state *state,
@@ -152,6 +154,8 @@ extern struct token_parse_result arith_parse_do(
/* statement parser callbacks */
extern struct token_parse_result stmt_parse_try(
struct ivy_parser *ctx, struct ivy_token *tok);
extern struct token_parse_result stmt_parse_for(
struct ivy_parser *ctx, struct ivy_token *tok);
extern struct token_parse_result stmt_parse_while(