lang: ast: implement parsing of inline and standalone if-else statements

This commit is contained in:
2024-12-04 16:35:19 +00:00
parent d2677e2038
commit c23523ce14
19 changed files with 641 additions and 134 deletions

25
lang/ast/cond.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef _AST_COND_H_
#define _AST_COND_H_
#include "ctx.h"
#include "node.h"
enum cond_group_type {
COND_GROUP_NONE = 0,
COND_GROUP_IF_ELSE,
COND_GROUP_INLINE_IF_ELSE,
COND_GROUP_MATCH,
};
struct cond_group_parser_state {
struct parser_state s_base;
enum cond_group_type s_type;
unsigned int s_prev_token;
struct ivy_ast_cond_node *s_cur_branch;
b_queue s_branches;
struct ivy_ast_node *s_prev_node;
};
#endif