aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-13 13:17:28 +0900
committernsfisis <nsfisis@gmail.com>2025-09-13 13:17:28 +0900
commita7c9c3407582f0d8d66539cf90e86fe3100787c5 (patch)
treeb8b4132ee0c116fae50f45107f3ae89a9a1911a6 /src/parse.c
parent8de7fa9da5fd8015f4fcc826b9270061b7b89478 (diff)
downloadducc-a7c9c3407582f0d8d66539cf90e86fe3100787c5.tar.gz
ducc-a7c9c3407582f0d8d66539cf90e86fe3100787c5.tar.zst
ducc-a7c9c3407582f0d8d66539cf90e86fe3100787c5.zip
feat: implement cast expression
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/parse.c b/src/parse.c
index b6fa043..b65a6b3 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -577,8 +577,7 @@ static AstNode* parse_cast_expr(Parser* p) {
// TODO: check whether the original type can be casted to the result type.
AstNode* e = parse_cast_expr(p);
- e->ty = ty;
- return e;
+ return ast_new_cast_expr(e, ty);
}
return parse_prefix_expr(p);
}