1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-12-01 16:50:09 +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.src, ForwardReference):
instr.src = self.lookup(instr.src.name)
if instr.opcode in ('call', 'goto'):
if isinstance(instr.location, ForwardReference): if isinstance(instr.location, ForwardReference):
instr.location = self.lookup(instr.location.name) instr.location = self.lookup(instr.location.name)
if isinstance(instr.src, ForwardReference):
instr.src = self.lookup(instr.src.name)
if isinstance(instr.dest, ForwardReference):
instr.dest = self.lookup(instr.dest.name)
return program return program