# HG changeset patch # User Paul Boddie # Date 1475756885 -7200 # Node ID 5bc15bdabf2a81a4b1e9d3744d35fee1693e3858 # Parent 985a0cc2522b2929c92568c2c2f627a3fc7e1437 Record invocation as well as assignment in the access modifiers. diff -r 985a0cc2522b -r 5bc15bdabf2a deducer.py --- a/deducer.py Wed Oct 05 17:25:39 2016 +0200 +++ b/deducer.py Thu Oct 06 14:28:05 2016 +0200 @@ -788,12 +788,13 @@ # For each access, determine the name versions affected by # assignments. - for access_number, assignment in enumerate(modifiers): + for access_number, modifier in enumerate(modifiers): if name: access_location = (path, name, attrnames, access_number) else: access_location = (path, None, attrnames, 0) + assignment = modifier == "A" if assignment: self.reference_assignments.add(access_location) diff -r 985a0cc2522b -r 5bc15bdabf2a encoders.py --- a/encoders.py Wed Oct 05 17:25:39 2016 +0200 +++ b/encoders.py Thu Oct 06 14:28:05 2016 +0200 @@ -74,16 +74,15 @@ def encode_modifier_term(t): - "Encode modifier 't' representing assignment status." + "Encode modifier 't' representing assignment or invocation status." - assignment = t - return assignment and "A" or "_" + return t def decode_modifier_term(s): - "Decode modifier term 's' representing assignment status." + "Decode modifier term 's' representing assignment or invocation status." - return s == "A" + return s diff -r 985a0cc2522b -r 5bc15bdabf2a inspector.py --- a/inspector.py Wed Oct 05 17:25:39 2016 +0200 +++ b/inspector.py Thu Oct 06 14:28:05 2016 +0200 @@ -43,6 +43,7 @@ self.in_class = False self.in_conditional = False + self.in_invocation = False self.global_attr_accesses = {} # Usage tracking. @@ -708,7 +709,10 @@ try: # Process the expression, obtaining any identified reference. + in_invocation = self.in_invocation + self.in_invocation = True name_ref = self.process_structure_node(n.node) + self.in_invocation = in_invocation # Process the arguments. @@ -1083,7 +1087,7 @@ init_item(self.attr_access_modifiers[path], access, list) access_number = len(self.attr_access_modifiers[path][access]) - self.attr_access_modifiers[path][access].append(assignment) + self.attr_access_modifiers[path][access].append(assignment and "A" or self.in_invocation and "I" or "_") return access_number def record_global_access_details(self, name, attrnames):