ILOC: allow moving instruction between programs, aligned comment prettyPrint

This commit is contained in:
User 2017-11-28 16:30:49 +01:00
parent 8fa96cb362
commit 7ddbca1ef1
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ public abstract class Instr implements Iterable<Op> {
/** Sets the line number of this instruction. */
void setLine(int line) {
assert this.line < 0 && line >= 0;
assert line >= 0;
this.line = line;
}
@ -70,7 +70,7 @@ public abstract class Instr implements Iterable<Op> {
/** Sets the program in which this instruction occurs.
*/
void setProgram(Program prog) {
assert this.prog == null & prog != null;
assert prog != null;
this.prog = prog;
}

View File

@ -142,7 +142,7 @@ public class Op extends Instr {
if (getClaz() == COMMENT) {
result.append(toCommentString());
}
if (getOpCode() == OpCode.out) {
else if (getOpCode() == OpCode.out) {
int size = sourceSize + targetSize + arrowSize;
result.append(String.format("%-8s", getOpCode().name()));
result.append(String.format("%-" + size + "s ", toSourceString()));