# HG changeset patch # User paulb@jeremy # Date 1162153323 -3600 # Node ID fe1ba226dddc5bc965510360282166dc85873139 # Parent 47cfa96935f6baaf6b2a3438dbecf0ca82f658c6 Introduced propagation of raised exceptions. diff -r 47cfa96935f6 -r fe1ba226dddc annotate.py --- a/annotate.py Sun Oct 29 18:44:17 2006 +0100 +++ b/annotate.py Sun Oct 29 21:22:03 2006 +0100 @@ -185,6 +185,7 @@ # Obtain the return values. self.last_returns = self.namespace.returns + self.last_raises = self.namespace.raises self.returned_locals = self.namespace.return_locals # Restore the previous subprogram and namespace. @@ -534,6 +535,11 @@ else: instance = type.instances[0] + #instance = Instance() + #instance.namespace = Namespace() + #instance.namespace.store("__class__", [Attribute(None, type)]) + #type.instances.append(instance) + node.instances[(reason, target, type)] = instance return node.instances[(reason, target, type)] @@ -589,6 +595,10 @@ for locals in self.returned_locals: self.namespace.merge_namespace(locals) + # Incorporate any raised exceptions. + + combine(self.namespace.raises, self.last_raises) + def process_args(self, invocation): """ @@ -864,7 +874,11 @@ class Self: - "A node encapsulating object/context information in an argument list." + """ + A program node encapsulating object/context information in an argument list. + This is not particularly like Attribute, Class, Instance or other such + things, since it actually appears in the program representation. + """ def __init__(self, attribute): self.types = [attribute]