# HG changeset patch # User paulb@localhost.localdomain # Date 1185580686 -7200 # Node ID fa0da921e79b735a350c66ed301b4b3baf36d794 # Parent 35cc350e666adf7968eacd077f9479b98c9653db Made subprogram attributes on visitors sets instead of lists, fixing duplication. Removed a redundant attribute on the annotation visitor. diff -r 35cc350e666a -r fa0da921e79b simplify/annotate.py --- a/simplify/annotate.py Sat Jul 28 01:56:30 2007 +0200 +++ b/simplify/annotate.py Sat Jul 28 01:58:06 2007 +0200 @@ -147,7 +147,6 @@ built-in classes and functions. """ - self.subprograms = [] self.current_subprograms = set() self.current_namespaces = [] self.rerun_subprograms = {} diff -r 35cc350e666a -r fa0da921e79b simplify/fixinstances.py --- a/simplify/fixinstances.py Sat Jul 28 01:56:30 2007 +0200 +++ b/simplify/fixinstances.py Sat Jul 28 01:58:06 2007 +0200 @@ -72,7 +72,7 @@ # recursion issues) and a list of current namespaces (used to recall # namespaces upon invoking internal subprograms). - self.subprograms = [] + self.subprograms = set() self.current_subprograms = [] self.module = module @@ -87,7 +87,7 @@ if not getattr(subprogram, "internal", 0): for specialised in subprogram.active(): - self.subprograms.append(self.process_node(specialised)) + self.subprograms.add(self.process_node(specialised)) def process_structures(self, module): @@ -250,7 +250,7 @@ subprogram = self.process_node(invoke.ref) if subprogram is not None: - self.subprograms.append(subprogram) + self.subprograms.add(subprogram) return invoke # Convenience functions. diff -r 35cc350e666a -r fa0da921e79b simplify/fixnames.py --- a/simplify/fixnames.py Sat Jul 28 01:56:30 2007 +0200 +++ b/simplify/fixnames.py Sat Jul 28 01:58:06 2007 +0200 @@ -101,7 +101,7 @@ # recursion issues) and a list of current namespaces (used to recall # namespaces upon invoking internal subprograms). - self.subprograms = [] + self.subprograms = set() self.current_subprograms = [] self.current_namespaces = [] @@ -128,7 +128,7 @@ # Invoke nodes. if not getattr(subprogram, "internal", 0): - self.subprograms.append(self.process_node(subprogram)) + self.subprograms.add(self.process_node(subprogram)) # Ultimately, we redefine the list of subprograms on the visitor. @@ -408,7 +408,7 @@ subprogram = self.process_node(invoke.ref) if subprogram is not None: - self.subprograms.append(subprogram) + self.subprograms.add(subprogram) return invoke class ScopeMismatch(Exception):