lang: ast: implement parsing of inline and standalone if-else statements
This commit is contained in:
25
lang/ast/cond.h
Normal file
25
lang/ast/cond.h
Normal 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
|
||||
Reference in New Issue
Block a user