# HG changeset patch # User Paul Boddie # Date 1530826876 -7200 # Node ID ea1e1157afc4bea57e7ce3305e837746db651d54 # Parent 3fda355ec392461351f14fc3578b117004d2ff0d# Parent d305986d05c873a86f06471ec962e69de543b7c7 Merged changes from the default branch. diff -r 3fda355ec392 -r ea1e1157afc4 deducer.py --- a/deducer.py Thu Jul 05 19:36:14 2018 +0200 +++ b/deducer.py Thu Jul 05 23:41:16 2018 +0200 @@ -659,24 +659,22 @@ attrname = location.get_attrname() - self.reference_all_attrs[location] = all_accessed_attrs = [] - self.reference_all_providers[location] = all_providers = [] + self.reference_all_attrs[location] = all_accessed_attrs = set() + self.reference_all_providers[location] = all_providers = set() self.reference_all_provider_kinds[location] = all_provider_kinds = set() # Obtain provider and attribute details for this kind of # object. for attrtype, object_type, attr in referenced_attrs: - all_accessed_attrs.append(attr) - all_providers.append(object_type) + all_accessed_attrs.add(attr) + all_providers.add(object_type) all_provider_kinds.add(attrtype) # Obtain reference and provider information as sets for the # operations below, retaining the list forms for use with # instruction plan preparation. - all_accessed_attrs = set(all_accessed_attrs) - all_providers = set(all_providers) all_general_providers = self.get_most_general_types(all_providers) # Determine which attributes would be provided by the @@ -1930,9 +1928,9 @@ "Return the references identified for 'access_location'." - attrs = [] + attrs = set() for attrtype, object_type, attr in self.referenced_attrs[access_location]: - attrs.append(attr) + attrs.add(attr) return attrs def convert_invocation_providers(self, refs, invocation): diff -r 3fda355ec392 -r ea1e1157afc4 translator.py --- a/translator.py Thu Jul 05 19:36:14 2018 +0200 +++ b/translator.py Thu Jul 05 23:41:16 2018 +0200 @@ -601,8 +601,7 @@ # Get full final identity details. if final_identity and not refs: - ref = self.importer.identify(final_identity) - refs = [ref] + refs = set([self.importer.identify(final_identity)]) del self.attrs[0] return AttrResult(output, refs, location, context_identity, context_identity_verified, accessor_test) @@ -661,14 +660,9 @@ access_location = self.deducer.const_accesses.get(location) if remaining and not access_location: - return [] - - refs = [] - l = self.deducer.referenced_attrs.get(access_location or location) - if l: - for attrtype, objpath, attr in l: - refs.append(attr) - return refs + return set() + + return self.deducer.get_references_for_access(access_location or location) def get_referenced_attribute_invocations(self, location):