refactor(ast): 调整AST结构体和枚举类型的声明表示方式
将结构体、联合和枚举类型的字段表示从向量改为声明指针, 允许name和decl字段为null,更新相关初始化函数的断言检查, 使结构更加灵活并支持不完整类型定义。 BREAKING CHANGE: 修改了scc_ast_type结构体中record和enumeration 子类型的字段表示方法,从fields向量改为decl指针。
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
typedef void (*scc_sema_callback_t)(void *context,
|
||||
scc_ast_node_type_t node_type, void *node);
|
||||
|
||||
typedef scc_ast_type_t *(*scc_sema_got_type_t)(void *context, const char *name);
|
||||
|
||||
/**
|
||||
* @brief 语义分析回调集合
|
||||
*/
|
||||
@@ -17,6 +19,7 @@ typedef struct scc_sema_callbacks {
|
||||
scc_sema_callback_t on_stmt;
|
||||
scc_sema_callback_t on_expr;
|
||||
scc_sema_callback_t on_type;
|
||||
scc_sema_got_type_t got_type;
|
||||
void *context;
|
||||
} scc_sema_callbacks_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user