Compound assign statement

This commit is contained in:
2026-05-16 22:40:01 +02:00
parent 60e5995dc6
commit c9030809fd
5 changed files with 52 additions and 8 deletions
+14 -1
View File
@@ -545,10 +545,23 @@ impl ToRust for Statement {
cg.add_indentedln(&format!("let {}{};", decl.get_rust(), init));
}
Statement::VarAssign(VarAssignStmt { target, value }) => {
Statement::Assign { target, value } => {
cg.add_indentedln(&format!("{} = {};", target.get_rust(), value.get_rust(),));
}
Statement::CompoundAssign {
target,
compound,
value,
} => {
cg.add_indentedln(&format!(
"{} {} {};",
target.get_rust(),
compound,
value.get_rust(),
));
}
Statement::Match(expr, match_items) => {
cg.add_indentedln(&format!("match {} {{", expr.get_rust()));
cg.indent += 1;