1.1 --- a/annotate.py Sun Oct 29 18:44:17 2006 +0100
1.2 +++ b/annotate.py Sun Oct 29 21:22:03 2006 +0100
1.3 @@ -185,6 +185,7 @@
1.4 # Obtain the return values.
1.5
1.6 self.last_returns = self.namespace.returns
1.7 + self.last_raises = self.namespace.raises
1.8 self.returned_locals = self.namespace.return_locals
1.9
1.10 # Restore the previous subprogram and namespace.
1.11 @@ -534,6 +535,11 @@
1.12 else:
1.13 instance = type.instances[0]
1.14
1.15 + #instance = Instance()
1.16 + #instance.namespace = Namespace()
1.17 + #instance.namespace.store("__class__", [Attribute(None, type)])
1.18 + #type.instances.append(instance)
1.19 +
1.20 node.instances[(reason, target, type)] = instance
1.21
1.22 return node.instances[(reason, target, type)]
1.23 @@ -589,6 +595,10 @@
1.24 for locals in self.returned_locals:
1.25 self.namespace.merge_namespace(locals)
1.26
1.27 + # Incorporate any raised exceptions.
1.28 +
1.29 + combine(self.namespace.raises, self.last_raises)
1.30 +
1.31 def process_args(self, invocation):
1.32
1.33 """
1.34 @@ -864,7 +874,11 @@
1.35
1.36 class Self:
1.37
1.38 - "A node encapsulating object/context information in an argument list."
1.39 + """
1.40 + A program node encapsulating object/context information in an argument list.
1.41 + This is not particularly like Attribute, Class, Instance or other such
1.42 + things, since it actually appears in the program representation.
1.43 + """
1.44
1.45 def __init__(self, attribute):
1.46 self.types = [attribute]