1.1 --- a/deducer.py Wed Oct 05 17:25:39 2016 +0200
1.2 +++ b/deducer.py Thu Oct 06 14:28:05 2016 +0200
1.3 @@ -788,12 +788,13 @@
1.4 # For each access, determine the name versions affected by
1.5 # assignments.
1.6
1.7 - for access_number, assignment in enumerate(modifiers):
1.8 + for access_number, modifier in enumerate(modifiers):
1.9 if name:
1.10 access_location = (path, name, attrnames, access_number)
1.11 else:
1.12 access_location = (path, None, attrnames, 0)
1.13
1.14 + assignment = modifier == "A"
1.15 if assignment:
1.16 self.reference_assignments.add(access_location)
1.17
2.1 --- a/encoders.py Wed Oct 05 17:25:39 2016 +0200
2.2 +++ b/encoders.py Thu Oct 06 14:28:05 2016 +0200
2.3 @@ -74,16 +74,15 @@
2.4
2.5 def encode_modifier_term(t):
2.6
2.7 - "Encode modifier 't' representing assignment status."
2.8 + "Encode modifier 't' representing assignment or invocation status."
2.9
2.10 - assignment = t
2.11 - return assignment and "A" or "_"
2.12 + return t
2.13
2.14 def decode_modifier_term(s):
2.15
2.16 - "Decode modifier term 's' representing assignment status."
2.17 + "Decode modifier term 's' representing assignment or invocation status."
2.18
2.19 - return s == "A"
2.20 + return s
2.21
2.22
2.23
3.1 --- a/inspector.py Wed Oct 05 17:25:39 2016 +0200
3.2 +++ b/inspector.py Thu Oct 06 14:28:05 2016 +0200
3.3 @@ -43,6 +43,7 @@
3.4
3.5 self.in_class = False
3.6 self.in_conditional = False
3.7 + self.in_invocation = False
3.8 self.global_attr_accesses = {}
3.9
3.10 # Usage tracking.
3.11 @@ -708,7 +709,10 @@
3.12 try:
3.13 # Process the expression, obtaining any identified reference.
3.14
3.15 + in_invocation = self.in_invocation
3.16 + self.in_invocation = True
3.17 name_ref = self.process_structure_node(n.node)
3.18 + self.in_invocation = in_invocation
3.19
3.20 # Process the arguments.
3.21
3.22 @@ -1083,7 +1087,7 @@
3.23 init_item(self.attr_access_modifiers[path], access, list)
3.24
3.25 access_number = len(self.attr_access_modifiers[path][access])
3.26 - self.attr_access_modifiers[path][access].append(assignment)
3.27 + self.attr_access_modifiers[path][access].append(assignment and "A" or self.in_invocation and "I" or "_")
3.28 return access_number
3.29
3.30 def record_global_access_details(self, name, attrnames):