1.1 --- a/translator.py Mon Mar 20 23:55:26 2017 +0100
1.2 +++ b/translator.py Tue Mar 21 00:12:25 2017 +0100
1.3 @@ -557,6 +557,7 @@
1.4
1.5 context_index = self.function_target - 1
1.6 context_identity = None
1.7 + final_identity = None
1.8
1.9 # Obtain encoded versions of each instruction, accumulating temporary
1.10 # variables.
1.11 @@ -569,6 +570,13 @@
1.12 context_identity, _substituted = encode_access_instruction_arg(instruction[1], subs, instruction[0], context_index)
1.13 continue
1.14
1.15 + # Intercept a special instruction identifying the target. The value
1.16 + # is not encoded since it is used internally.
1.17 +
1.18 + if instruction[0] == "<final_identity>":
1.19 + final_identity = instruction[1]
1.20 + continue
1.21 +
1.22 # Collect the encoded instruction, noting any temporary variables
1.23 # required by it.
1.24
1.25 @@ -582,6 +590,12 @@
1.26 if self.temp_subs.has_key(sub):
1.27 self.record_temp(self.temp_subs[sub])
1.28
1.29 + # Get full final identity details.
1.30 +
1.31 + if final_identity and not refs:
1.32 + ref = self.importer.identify(final_identity)
1.33 + refs = [ref]
1.34 +
1.35 del self.attrs[0]
1.36 return AttrResult(output, refs, location, context_identity)
1.37
1.38 @@ -629,19 +643,6 @@
1.39 identified attributes.
1.40 """
1.41
1.42 - # Find any static attribute.
1.43 -
1.44 - plan = self.deducer.access_plans.get(location)
1.45 - if plan:
1.46 - name, test, test_type, base, \
1.47 - traversed, traversal_modes, remaining, \
1.48 - context, context_test, \
1.49 - first_method, final_method, \
1.50 - origin, accessor_kinds = plan
1.51 -
1.52 - if origin:
1.53 - return [self.importer.get_object(origin)]
1.54 -
1.55 # Determine whether any deduced references refer to the accessed
1.56 # attribute.
1.57