From a7c9c3407582f0d8d66539cf90e86fe3100787c5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 13 Sep 2025 13:17:28 +0900 Subject: feat: implement cast expression --- src/ast.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index 84fe38e..d698543 100644 --- a/src/ast.c +++ b/src/ast.c @@ -282,6 +282,13 @@ AstNode* ast_new_member_access_expr(AstNode* obj, const char* name) { return e; } +AstNode* ast_new_cast_expr(AstNode* operand, Type* result_ty) { + AstNode* e = ast_new(AstNodeKind_cast_expr); + e->node_operand = operand; + e->ty = result_ty; + return e; +} + int type_sizeof_struct(Type* ty) { int next_offset = 0; int struct_align = 0; -- cgit v1.2.3-70-g09d2