Generalize forward reference resolution a smidge.
Chris Pressey
4 years ago
121 | 121 | if not isinstance(model.type, (RoutineType, VectorType)): |
122 | 122 | self.syntax_error('Illegal call of non-executable "%s"' % name) |
123 | 123 | 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) | |
131 | 127 | |
132 | 128 | return program |
133 | 129 |