From cdddf2422553f1f21c8d2c57cd382b8362dc80fb Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 7 Feb 2026 15:42:00 +0900 Subject: feat: support function calls via function pointers The two-pass parsing of function pointer declaration is referenced from chibicc: https://github.com/rui314/chibicc --- src/ast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index c2e1aba..eb478c5 100644 --- a/src/ast.c +++ b/src/ast.c @@ -454,11 +454,11 @@ AstNode* ast_new_str_expr(int idx, Type* ty) { return e; } -AstNode* ast_new_func_call(const char* name, Type* ty) { +AstNode* ast_new_func_call(AstNode* func, AstNode* args) { AstNode* e = ast_new(AstNodeKind_func_call); e->as.func_call = calloc(1, sizeof(FuncCallNode)); - e->as.func_call->name = name; - e->ty = ty; + e->as.func_call->func = func; + e->as.func_call->args = args; return e; } -- cgit v1.3-1-g0d28