aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-09-28 10:35:44 +0900
committernsfisis <nsfisis@gmail.com>2025-09-28 10:35:44 +0900
commit931cbe657ccdcfefe4077cd7371f1ea4ad4e5b53 (patch)
treefe0950e80e3ff1a6a559ac4b169a6991131816a9 /src/parse.c
parent86ae353d6267387bf216d5fd760a7ced7bced402 (diff)
downloadducc-931cbe657ccdcfefe4077cd7371f1ea4ad4e5b53.tar.gz
ducc-931cbe657ccdcfefe4077cd7371f1ea4ad4e5b53.tar.zst
ducc-931cbe657ccdcfefe4077cd7371f1ea4ad4e5b53.zip
feat: implement |=, &=, ^=, <<= and >>= operators
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parse.c b/src/parse.c
index da1345d..ba9b7e5 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -801,7 +801,8 @@ static AstNode* parse_assignment_expr(Parser* p) {
TokenKind op = peek_token(p)->kind;
// TODO: check if the lhs is unary expression.
if (op == TokenKind_assign || op == TokenKind_assign_mul || op == TokenKind_assign_div ||
- op == TokenKind_assign_mod) {
+ op == TokenKind_assign_mod || op == TokenKind_assign_or || op == TokenKind_assign_and ||
+ op == TokenKind_assign_xor || op == TokenKind_assign_lshift || op == TokenKind_assign_rshift) {
next_token(p);
AstNode* rhs = parse_assignment_expr(p);
lhs = ast_new_assign_expr(op, lhs, rhs);