1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-11-29 18:49:22 +00:00

Even more general.

This commit is contained in:
Chris Pressey 2018-09-07 13:42:18 +01:00
parent af0e1b41c7
commit d70092c373

View File

@ -115,11 +115,12 @@ class Parser(object):
for node in program.all_children(): for node in program.all_children():
if isinstance(node, SingleOp): if isinstance(node, SingleOp):
instr = node instr = node
if isinstance(instr.location, ForwardReference):
instr.location = self.lookup(instr.location.name)
if isinstance(instr.src, ForwardReference): if isinstance(instr.src, ForwardReference):
instr.src = self.lookup(instr.src.name) instr.src = self.lookup(instr.src.name)
if instr.opcode in ('call', 'goto'): if isinstance(instr.dest, ForwardReference):
if isinstance(instr.location, ForwardReference): instr.dest = self.lookup(instr.dest.name)
instr.location = self.lookup(instr.location.name)
return program return program