Correct For loop behavior and add a name to Trait

TODO: implement Trait and Use
This commit is contained in:
flameyosflow 2025-12-16 12:12:33 +02:00
commit 12fee4b213

View file

@ -99,7 +99,7 @@ impl Transpiler {
// But for now, skip as they're handled differently
}
TypedASTNodeKind::Load(_) => {}
TypedASTNodeKind::Trait(_) => {}
TypedASTNodeKind::Trait(typed_trait ) => {}
TypedASTNodeKind::Use(_) => {}
}
Ok(())
@ -227,7 +227,7 @@ impl Transpiler {
}
CStmt::For(init, cond, incr, body) => {
let mut output = format!("for ({}, {}, {}) {{", self.generate_var_decl(init), self.generate_expr(cond), self.generate_expr(incr));
let mut output = format!("for ({}; {}; {}) {{", self.generate_var_decl(init), self.generate_expr(cond), self.generate_expr(incr));
for stmt in body {
output.push_str(&format!(" {}", self.generate_stmt(stmt)));
}