1.1 --- a/deducer.py Wed Oct 12 00:05:08 2016 +0200
1.2 +++ b/deducer.py Wed Oct 12 18:07:48 2016 +0200
1.3 @@ -400,14 +400,14 @@
1.4
1.5 for location in locations:
1.6 name, test, test_type, base, traversed, attrnames, context, \
1.7 - method, attr = self.access_plans[location]
1.8 + first_method, final_method, attr = self.access_plans[location]
1.9
1.10 print >>f_attrs, encode_access_location(location), \
1.11 name, test, test_type or "{}", \
1.12 base or "{}", \
1.13 ".".join(traversed) or "{}", \
1.14 ".".join(attrnames) or "{}", \
1.15 - context, method, attr or "{}"
1.16 + context, first_method, final_method, attr or "{}"
1.17
1.18 finally:
1.19 f_attrs.close()
1.20 @@ -1888,31 +1888,34 @@
1.21 # Identified attribute that must be accessed via its parent.
1.22
1.23 if attr and attr.get_name() and location in self.reference_assignments:
1.24 - method = "assign"; origin = attr.get_name()
1.25 + final_method = "assign"; origin = attr.get_name()
1.26
1.27 # Static, identified attribute.
1.28
1.29 elif attr and attr.static():
1.30 - method = "static"; origin = attr.final()
1.31 + final_method = "static"; origin = attr.final()
1.32 +
1.33 + # All other methods of access involve traversal.
1.34 +
1.35 + else:
1.36 + final_method = "access"; origin = None
1.37
1.38 # First attribute accessed at a known position via the accessor.
1.39
1.40 - elif base or dynamic_base:
1.41 - method = "relative" + (object_relative and "-object" or "") + \
1.42 - (class_relative and "-class" or "")
1.43 - origin = None
1.44 + if base or dynamic_base:
1.45 + first_method = "relative" + (object_relative and "-object" or "") + \
1.46 + (class_relative and "-class" or "")
1.47
1.48 # The fallback case is always run-time testing and access.
1.49
1.50 else:
1.51 - method = "check" + (object_relative and "-object" or "") + \
1.52 - (class_relative and "-class" or "")
1.53 - origin = None
1.54 + first_method = "check" + (object_relative and "-object" or "") + \
1.55 + (class_relative and "-class" or "")
1.56
1.57 # Determine the nature of the context.
1.58
1.59 context = len(traversed or remaining) == 1 and (base and "base" or "original-accessor") or "final-accessor"
1.60
1.61 - return name, test, test_type, base, traversed, remaining, context, method, origin
1.62 + return name, test, test_type, base, traversed, remaining, context, first_method, final_method, origin
1.63
1.64 # vim: tabstop=4 expandtab shiftwidth=4