1.1 --- a/deducer.py Tue Mar 28 22:46:19 2017 +0200
1.2 +++ b/deducer.py Wed Mar 29 00:18:41 2017 +0200
1.3 @@ -23,9 +23,10 @@
1.4 get_attrname_from_location, get_attrnames, \
1.5 get_invoked_attributes, get_name_path, init_item, \
1.6 order_dependencies_partial, sorted_output, CommonOutput
1.7 -from encoders import encode_access_location, encode_constrained, \
1.8 - encode_instruction, encode_location, encode_usage, \
1.9 - get_kinds, test_label_for_kind, test_label_for_type
1.10 +from encoders import encode_access_location, encode_alias_location, \
1.11 + encode_constrained, encode_instruction, encode_location, \
1.12 + encode_usage, get_kinds, \
1.13 + test_label_for_kind, test_label_for_type
1.14 from errors import DeduceError
1.15 from os.path import join
1.16 from referencing import combine_types, is_single_class_type, separate_types, \
1.17 @@ -320,8 +321,10 @@
1.18 for location in locations:
1.19 accesses = []
1.20 for access_location in self.alias_index[location]:
1.21 - accesses.append(encode_access_location(access_location))
1.22 - print >>f_aliases, encode_location(location), ", ".join(accesses)
1.23 + invocation = access_location in self.reference_invocations
1.24 + accesses.append(encode_alias_location(access_location, invocation))
1.25 + invocation = location in self.reference_invocations
1.26 + print >>f_aliases, encode_alias_location(location, invocation), ", ".join(accesses)
1.27
1.28 finally:
1.29 f_type_summary.close()
2.1 --- a/encoders.py Tue Mar 28 22:46:19 2017 +0200
2.2 +++ b/encoders.py Wed Mar 29 00:18:41 2017 +0200
2.3 @@ -79,6 +79,13 @@
2.4 path, name, attrname, version = t
2.5 return "%s:%s:%s:%d" % (path, name or "{}", attrname or "{}", version)
2.6
2.7 +def encode_alias_location(t, invocation=False):
2.8 +
2.9 + "Encode the alias location 't'."
2.10 +
2.11 + path, name, attrname, version = t
2.12 + return "%s:%s:%s:%d%s" % (path, name or "{}", attrname or "{}", version, invocation and "!" or "")
2.13 +
2.14 def encode_location(t):
2.15
2.16 "Encode the general location 't' in a concise form."