git @ Cat's Eye Technologies SixtyPical / 26a2fb4
Generalize forward reference resolution a smidge. Chris Pressey 4 years ago
1 changed file(s) with 3 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
121121 if not isinstance(model.type, (RoutineType, VectorType)):
122122 self.syntax_error('Illegal call of non-executable "%s"' % name)
123123 instr.location = model
124 if instr.opcode in ('copy',) and isinstance(instr.src, ForwardReference):
125 forward_reference = instr.src
126 name = forward_reference.name
127 model = self.lookup(name)
128 if not isinstance(model.type, (RoutineType, VectorType)):
129 self.syntax_error('Illegal copy of non-executable "%s"' % name)
130 instr.src = model
124 if instr.opcode in ('copy',):
125 if isinstance(instr.src, ForwardReference):
126 instr.src = self.lookup(instr.src.name)
131127
132128 return program
133129