# HG changeset patch # User Paul Boddie # Date 1490739521 -7200 # Node ID f5b309580228718b7386162e025a95b8d88ff352 # Parent 9ec1872daea4c470bb8a2915b2655967b2811e82 Incorporate invocation details in the alias output. diff -r 9ec1872daea4 -r f5b309580228 deducer.py --- a/deducer.py Tue Mar 28 22:46:19 2017 +0200 +++ b/deducer.py Wed Mar 29 00:18:41 2017 +0200 @@ -23,9 +23,10 @@ get_attrname_from_location, get_attrnames, \ get_invoked_attributes, get_name_path, init_item, \ order_dependencies_partial, sorted_output, CommonOutput -from encoders import encode_access_location, encode_constrained, \ - encode_instruction, encode_location, encode_usage, \ - get_kinds, test_label_for_kind, test_label_for_type +from encoders import encode_access_location, encode_alias_location, \ + encode_constrained, encode_instruction, encode_location, \ + encode_usage, get_kinds, \ + test_label_for_kind, test_label_for_type from errors import DeduceError from os.path import join from referencing import combine_types, is_single_class_type, separate_types, \ @@ -320,8 +321,10 @@ for location in locations: accesses = [] for access_location in self.alias_index[location]: - accesses.append(encode_access_location(access_location)) - print >>f_aliases, encode_location(location), ", ".join(accesses) + invocation = access_location in self.reference_invocations + accesses.append(encode_alias_location(access_location, invocation)) + invocation = location in self.reference_invocations + print >>f_aliases, encode_alias_location(location, invocation), ", ".join(accesses) finally: f_type_summary.close() diff -r 9ec1872daea4 -r f5b309580228 encoders.py --- a/encoders.py Tue Mar 28 22:46:19 2017 +0200 +++ b/encoders.py Wed Mar 29 00:18:41 2017 +0200 @@ -79,6 +79,13 @@ path, name, attrname, version = t return "%s:%s:%s:%d" % (path, name or "{}", attrname or "{}", version) +def encode_alias_location(t, invocation=False): + + "Encode the alias location 't'." + + path, name, attrname, version = t + return "%s:%s:%s:%d%s" % (path, name or "{}", attrname or "{}", version, invocation and "!" or "") + def encode_location(t): "Encode the general location 't' in a concise form."