Fix missing newline in Assign codegen

This commit is contained in:
Henry 2019-12-20 15:45:28 +00:00
parent 87fcbd1aa9
commit bb75a6a03e
3 changed files with 3 additions and 3 deletions

View file

@ -131,7 +131,7 @@ public class CodegenImpl implements Codegen {
Assign assign = (Assign) e; Assign assign = (Assign) e;
return compileExp(assign.e) return compileExp(assign.e)
+ String.format("sw a0,%d(s0)", assign.x * 4); + String.format("sw a0,%d(s0)\n", assign.x * 4);
} else if (e instanceof Continue) { } else if (e instanceof Continue) {
return "jr s2\n"; return "jr s2\n";
} else if (e instanceof Break) { } else if (e instanceof Break) {

View file

@ -131,7 +131,7 @@ public class CodegenImpl implements Codegen {
Assign assign = (Assign) e; Assign assign = (Assign) e;
return compileExp(assign.e) return compileExp(assign.e)
+ String.format("sw a0,%d(s0)", assign.x * 4); + String.format("sw a0,%d(s0)\n", assign.x * 4);
} else if (e instanceof Continue) { } else if (e instanceof Continue) {
return "jr s2\n"; return "jr s2\n";
} else if (e instanceof Break) { } else if (e instanceof Break) {

View file

@ -131,7 +131,7 @@ public class CodegenImpl implements Codegen {
Assign assign = (Assign) e; Assign assign = (Assign) e;
return compileExp(assign.e) return compileExp(assign.e)
+ String.format("sw a0,%d(s0)", assign.x * 4); + String.format("sw a0,%d(s0)\n", assign.x * 4);
} else if (e instanceof Continue) { } else if (e instanceof Continue) {
return "jr s2\n"; return "jr s2\n";
} else if (e instanceof Break) { } else if (e instanceof Break) {