On 06/27/2013 06:21 PM, Jakub Filak wrote:
instructions = []
current = None
Is the current variable necessary? It looks like that the current instruction is the last item in the instructions.
No, it isn't the last insn, because we do not stop when we see it.
The loop can be made simpler (we can stop when we see current insn), but I suspect later we might want to look also at insns which follow the current one. So I don't stop looping prematurely.
# There can be a disasm comment: "insn op,op,op # comment";
# strip it, and whitespace on both ends:
t = instructions[current].split("#", 1)[0].strip()
I'm afraid that the current can be length(instructions) and IMHO python indexes from 0.
Only if "=> ..............." points to a line without an instruction, which should not be happening.