1.1 --- a/deducer.py Thu Oct 20 15:00:27 2016 +0200
1.2 +++ b/deducer.py Thu Oct 20 22:43:48 2016 +0200
1.3 @@ -83,9 +83,10 @@
1.4
1.5 self.modified_attributes = {}
1.6
1.7 - # Accesses that are assignments.
1.8 + # Accesses that are assignments or invocations.
1.9
1.10 self.reference_assignments = set()
1.11 + self.reference_invocations = set()
1.12
1.13 # Map locations to types, constrained indicators and attributes.
1.14
1.15 @@ -796,8 +797,8 @@
1.16 # For each access, determine the name versions affected by
1.17 # assignments.
1.18
1.19 - for access_number, assignment in enumerate(modifiers):
1.20 - if not assignment:
1.21 + for access_number, (assignment, invocation) in enumerate(modifiers):
1.22 + if not assignment and not invocation:
1.23 continue
1.24
1.25 if name:
1.26 @@ -805,6 +806,10 @@
1.27 else:
1.28 access_location = (path, None, attrname_str, 0)
1.29
1.30 + if invocation:
1.31 + self.reference_invocations.add(access_location)
1.32 + continue
1.33 +
1.34 self.reference_assignments.add(access_location)
1.35
1.36 # Associate assignments with usage.
1.37 @@ -1955,6 +1960,7 @@
1.38 # Determine the method of access.
1.39
1.40 is_assignment = location in self.reference_assignments
1.41 + is_invocation = location in self.reference_invocations
1.42
1.43 # Identified attribute that must be accessed via its parent.
1.44
1.45 @@ -1964,7 +1970,9 @@
1.46 # Static, identified attribute.
1.47
1.48 elif attr and attr.static():
1.49 - final_method = is_assignment and "static-assign" or "static"
1.50 + final_method = is_assignment and "static-assign" or \
1.51 + is_invocation and "static-invoke" or \
1.52 + "static"
1.53 origin = attr.final()
1.54
1.55 # All other methods of access involve traversal.