aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-28 15:30:11 +0900
committernsfisis <nsfisis@gmail.com>2025-09-28 15:30:11 +0900
commit5a16856f8ff4dbf801b4a622ca7053b77e8a0214 (patch)
treea5f15bccc7b34802da8aa655d26c28848a832cff /src/parse.c
parent1b208f7f0a3b7d6b72c2a431d9fcd6e18fe76f5d (diff)
downloadducc-5a16856f8ff4dbf801b4a622ca7053b77e8a0214.tar.gz
ducc-5a16856f8ff4dbf801b4a622ca7053b77e8a0214.tar.zst
ducc-5a16856f8ff4dbf801b4a622ca7053b77e8a0214.zip
feat: implement bitwise not operator
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parse.c b/src/parse.c
index 80c7aac..b82c45d 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -547,6 +547,9 @@ static AstNode* parse_prefix_expr(Parser* p) {
} else if (consume_token_if(p, TokenKind_not)) {
AstNode* operand = parse_prefix_expr(p);
return ast_new_unary_expr(op, operand);
+ } else if (consume_token_if(p, TokenKind_tilde)) {
+ AstNode* operand = parse_prefix_expr(p);
+ return ast_new_unary_expr(op, operand);
} else if (consume_token_if(p, TokenKind_and)) {
AstNode* operand = parse_prefix_expr(p);
return ast_new_ref_expr(operand);