aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ast.h
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-07 15:42:00 +0900
committernsfisis <nsfisis@gmail.com>2026-02-07 17:33:55 +0900
commitcdddf2422553f1f21c8d2c57cd382b8362dc80fb (patch)
tree3053026498552aecda2e4889c8455298ad70c8cb /src/ast.h
parente1042a6373773830297dfd5718938c12f21ae624 (diff)
downloadducc-cdddf2422553f1f21c8d2c57cd382b8362dc80fb.tar.gz
ducc-cdddf2422553f1f21c8d2c57cd382b8362dc80fb.tar.zst
ducc-cdddf2422553f1f21c8d2c57cd382b8362dc80fb.zip
feat: support function calls via function pointers
The two-pass parsing of function pointer declaration is referenced from chibicc: https://github.com/rui314/chibicc
Diffstat (limited to 'src/ast.h')
-rw-r--r--src/ast.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ast.h b/src/ast.h
index 3f9eb82..fe2f720 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -188,7 +188,7 @@ typedef struct {
} RefExprNode;
typedef struct {
- const char* name;
+ AstNode* func;
AstNode* args;
} FuncCallNode;
@@ -387,7 +387,7 @@ AstNode* ast_new_cast_expr(AstNode* operand, Type* result_ty);
AstNode* ast_new_logical_expr(int op, AstNode* lhs, AstNode* rhs);
AstNode* ast_new_cond_expr(AstNode* cond, AstNode* then, AstNode* else_);
AstNode* ast_new_str_expr(int idx, Type* ty);
-AstNode* ast_new_func_call(const char* name, Type* ty);
+AstNode* ast_new_func_call(AstNode* func, AstNode* args);
AstNode* ast_new_func(const char* name, Type* ty);
AstNode* ast_new_gvar(const char* name, Type* ty);
AstNode* ast_new_lvar(const char* name, int stack_offset, Type* ty);