Correct For loop behavior and add a name to Trait
TODO: implement Trait and Use
This commit is contained in:
parent
21e37cd4f2
commit
12fee4b213
1 changed files with 2 additions and 2 deletions
|
|
@ -99,7 +99,7 @@ impl Transpiler {
|
||||||
// But for now, skip as they're handled differently
|
// But for now, skip as they're handled differently
|
||||||
}
|
}
|
||||||
TypedASTNodeKind::Load(_) => {}
|
TypedASTNodeKind::Load(_) => {}
|
||||||
TypedASTNodeKind::Trait(_) => {}
|
TypedASTNodeKind::Trait(typed_trait ) => {}
|
||||||
TypedASTNodeKind::Use(_) => {}
|
TypedASTNodeKind::Use(_) => {}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -227,7 +227,7 @@ impl Transpiler {
|
||||||
}
|
}
|
||||||
|
|
||||||
CStmt::For(init, cond, incr, body) => {
|
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 {
|
for stmt in body {
|
||||||
output.push_str(&format!(" {}", self.generate_stmt(stmt)));
|
output.push_str(&format!(" {}", self.generate_stmt(stmt)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue