aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-03 13:59:06 +0900
committernsfisis <nsfisis@gmail.com>2025-05-03 13:59:06 +0900
commit4cdf4ddb24fb6f7d46d65dc55f44af1ff50119b5 (patch)
tree3ef370b59df5f2fdffb63f48ef2165eda894eeb2 /main.c
parent1c44079167dbac07e71e177b3ef125755c4308fc (diff)
downloadP4Dcc-4cdf4ddb24fb6f7d46d65dc55f44af1ff50119b5.tar.gz
P4Dcc-4cdf4ddb24fb6f7d46d65dc55f44af1ff50119b5.tar.zst
P4Dcc-4cdf4ddb24fb6f7d46d65dc55f44af1ff50119b5.zip
parenthesized expression
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.c b/main.c
index b177901..e346738 100644
--- a/main.c
+++ b/main.c
@@ -285,6 +285,11 @@ AST* parse_primitive_expr(PARSER* p) {
buf[t->len] = 0;
e->int_value = atoi(buf);
return e;
+ } else if (t->kind == TK_PAREN_L) {
+ next_token(p);
+ AST* e = parse_expr(p);
+ expect(p, TK_PAREN_R);
+ return e;
} else {
fatal_error("parse_expr");
}