Working constructor and statements
This commit is contained in:
@@ -7,6 +7,7 @@ use crate::{GenRust, GetRust, RustCodegen};
|
||||
impl GenRust for Block {
|
||||
fn gen_rust(&self, ctx: &mut Context, cg: &mut RustCodegen) {
|
||||
for stmt in &self.0 {
|
||||
ctx.expr_ensure_semicolon = true;
|
||||
cg.add_indented("");
|
||||
stmt.gen_rust(ctx, cg);
|
||||
}
|
||||
@@ -14,7 +15,6 @@ impl GenRust for Block {
|
||||
if let Some(soft_return) = &self.1 {
|
||||
ctx.expr_ensure_semicolon = false;
|
||||
soft_return.gen_rust(ctx, cg);
|
||||
ctx.expr_ensure_semicolon = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user