From 7ddbca1ef1d39a7af053869f7f09bd281abadc4d Mon Sep 17 00:00:00 2001 From: User <> Date: Tue, 28 Nov 2017 16:30:49 +0100 Subject: [PATCH] ILOC: allow moving instruction between programs, aligned comment prettyPrint --- src/pp/iloc/model/Instr.java | 4 ++-- src/pp/iloc/model/Op.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pp/iloc/model/Instr.java b/src/pp/iloc/model/Instr.java index 9c39d69..a3fcfaa 100644 --- a/src/pp/iloc/model/Instr.java +++ b/src/pp/iloc/model/Instr.java @@ -34,7 +34,7 @@ public abstract class Instr implements Iterable { /** 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 { /** Sets the program in which this instruction occurs. */ void setProgram(Program prog) { - assert this.prog == null & prog != null; + assert prog != null; this.prog = prog; } diff --git a/src/pp/iloc/model/Op.java b/src/pp/iloc/model/Op.java index 90397e1..db678ed 100644 --- a/src/pp/iloc/model/Op.java +++ b/src/pp/iloc/model/Op.java @@ -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()));