Fixed block statements

This commit is contained in:
2026-05-22 03:00:43 +02:00
parent b7cfa9fbe6
commit d33763be2e
4 changed files with 23 additions and 7 deletions
+10 -3
View File
@@ -100,9 +100,16 @@ impl GenRust for Expression {
}
}
if ensure_semicolon {
ctx.expr_ensure_semicolon = true;
cg.add(";");
if let Expression::Statement(stmt) = self {
if !stmt.is_block() && ensure_semicolon {
ctx.expr_ensure_semicolon = true;
cg.add(";");
}
} else {
if ensure_semicolon {
ctx.expr_ensure_semicolon = true;
cg.add(";");
}
}
}
}