stage1 重新实现ast2ir
This commit is contained in:
1 parent
bcd26d3021
commit
ab6e99c958
10 files changed
+1175
-677
No files matched your search
+4
-12
@@ -49,7 +49,6 @@
|
||||
X(SPL_AST_EXPR_CAST, V0, cast) \
|
||||
X(SPL_AST_EXPR_TUPLE, V0, tuple) \
|
||||
X(SPL_AST_EXPR_ARRAY_LIT, V0, array_literal) \
|
||||
X(SPL_AST_EXPR_ANON_ARRAY_LIT, V0, anon_array_literal) \
|
||||
X(SPL_AST_EXPR_AGGREGATE_LIT, V0, aggregate_literal) \
|
||||
X(SPL_AST_EXPR_COMPTIME_CALL, V0, comptime_call) \
|
||||
X(SPL_AST_EXPR_BLOCK, V0, block) \
|
||||
@@ -151,11 +150,8 @@ typedef VEC(spl_ast_node_ref_t) spl_ast_node_ref_vec_t;
|
||||
struct spl_ast_node {
|
||||
spl_ast_node_kind_t kind;
|
||||
spl_dbg_node_t dbg;
|
||||
|
||||
union {
|
||||
usize resolved_def_id;
|
||||
usize resolved_type_id;
|
||||
};
|
||||
usize resolved_def_id;
|
||||
usize resolved_type_id;
|
||||
|
||||
union {
|
||||
/* SPL_AST_ROOT */
|
||||
@@ -356,16 +352,12 @@ struct spl_ast_node {
|
||||
bool has_len;
|
||||
usize len;
|
||||
bool is_underscore_len;
|
||||
spl_ast_node_ref_t elem_type;
|
||||
spl_ast_node_ref_t elem_type; /* 可空 匿名时为 NULL */
|
||||
spl_ast_node_ref_vec_t elems;
|
||||
} array_literal;
|
||||
|
||||
struct {
|
||||
spl_ast_node_ref_vec_t elems;
|
||||
} anon_array_literal;
|
||||
|
||||
struct {
|
||||
const char *name; /* 可空,匿名时为 NULL */
|
||||
const char *name; /* 可空 匿名时为 NULL */
|
||||
spl_ast_node_ref_vec_t fields; /* struct_init_item 节点列表 */
|
||||
} aggregate_literal;
|
||||
|
||||
|
||||
Reference in new issue
Block a user