aboutsummaryrefslogtreecommitdiffhomepage
path: root/codegen.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-07-29 06:09:06 +0900
committernsfisis <nsfisis@gmail.com>2025-08-15 10:04:35 +0900
commitf91a10ae153f41c46729605ecf0023d11ada07b8 (patch)
tree0bf858a43490f88e20fd4006543e069cfa54b43d /codegen.c
parentbd5bbdebf116bb03da335d0e18a55a5597b55548 (diff)
downloadducc-f91a10ae153f41c46729605ecf0023d11ada07b8.tar.gz
ducc-f91a10ae153f41c46729605ecf0023d11ada07b8.tar.zst
ducc-f91a10ae153f41c46729605ecf0023d11ada07b8.zip
feat: implement empty statements (only semicolon)
Diffstat (limited to 'codegen.c')
-rw-r--r--codegen.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/codegen.c b/codegen.c
index d290e95..4bb15e2 100644
--- a/codegen.c
+++ b/codegen.c
@@ -400,6 +400,9 @@ void codegen_expr_stmt(CodeGen* g, AstNode* ast) {
void codegen_var_decl(CodeGen* g, AstNode* ast) {
}
+void codegen_nop(CodeGen* g, AstNode* ast) {
+}
+
void codegen_block_stmt(CodeGen* g, AstNode* ast) {
int i;
for (i = 0; i < ast->node_len; ++i) {
@@ -427,6 +430,8 @@ void codegen_stmt(CodeGen* g, AstNode* ast) {
codegen_expr_stmt(g, ast);
} else if (ast->kind == AstNodeKind_lvar_decl) {
codegen_var_decl(g, ast);
+ } else if (ast->kind == AstNodeKind_nop) {
+ codegen_nop(g, ast);
} else {
unreachable();
}