feat(ast): 修改函数调用表达式的结构定义

在AST定义中将函数调用表达式的name字段替换为callee字段,
以支持更复杂的函数调用场景。同时更新了相关的初始化函数、
转储函数和解析逻辑,使函数调用表达式能够正确处理callee节点。

BREAKING CHANGE: 函数调用表达式的结构发生了改变,从使用name字符串
改为使用callee表达式节点。
This commit is contained in:
zzy committed 2026-03-10 14:33:32 +08:00
1 parent 2e331ee016
commit 742bede02f
7 files changed
+102 -23

No files matched your search

+1
View File
@@ -269,6 +269,7 @@ struct scc_ast_expr {
// 函数调用
struct {
const char *name;
scc_ast_expr_t *callee;
scc_ast_expr_t *_target;
scc_ast_expr_vec_t args;
} call;
+3 -3
View File
@@ -293,12 +293,12 @@ static inline void scc_ast_expr_cond_init(scc_ast_expr_t *expr,
// args can be null
static inline void scc_ast_expr_call_init(scc_ast_expr_t *expr,
const char *name,
scc_ast_expr_t *callee,
scc_ast_expr_vec_t *args) {
Assert(expr != null && name != null);
Assert(expr != null && callee != null);
expr->base.loc = scc_pos_create();
expr->base.type = SCC_AST_EXPR_CALL;
expr->call.name = name;
expr->call.callee = callee;
expr->call._target = null;
if (args == null) {
scc_vec_init(expr->call.args);