1.1 --- a/simplify/fixnames.py Sun Jul 29 23:29:19 2007 +0200
1.2 +++ b/simplify/fixnames.py Mon Jul 30 00:35:54 2007 +0200
1.3 @@ -127,7 +127,7 @@
1.4 # Internal subprograms are skipped here and processed specially via
1.5 # Invoke nodes.
1.6
1.7 - if not getattr(subprogram, "internal", 0):
1.8 + if not subprogram.internal:
1.9 self.subprograms.add(self.process_node(subprogram))
1.10
1.11 # Ultimately, we redefine the list of subprograms on the visitor.
1.12 @@ -149,7 +149,7 @@
1.13
1.14 # Obtain a namespace either based on locals or on a structure.
1.15
1.16 - structure = structure=getattr(node, "structure", None)
1.17 + structure = node.structure
1.18
1.19 # If passed some namespace, use that as the current namespace.
1.20
1.21 @@ -167,29 +167,29 @@
1.22 # NOTE: subprogram within itself. Do not define the name of the function
1.23 # NOTE: within a method definition.
1.24
1.25 - if isinstance(node, Subprogram) and getattr(node, "name", None) is not None and not getattr(node, "is_method", 0):
1.26 + if isinstance(node, Subprogram) and node.name is not None and not node.is_method:
1.27 self.namespace.store(node.name)
1.28
1.29 # Register the names of parameters in the namespace.
1.30
1.31 - if hasattr(node, "params"):
1.32 + if node.params:
1.33 new_params = []
1.34 for param, default in node.params:
1.35 new_params.append((param, self.dispatch(default)))
1.36 self.namespace.store(param)
1.37 node.params = new_params
1.38 - if getattr(node, "star", None):
1.39 + if node.star:
1.40 param, default = node.star
1.41 self.namespace.store(param)
1.42 node.star = param, self.dispatch(default)
1.43 - if getattr(node, "dstar", None):
1.44 + if node.dstar:
1.45 param, default = node.dstar
1.46 self.namespace.store(param)
1.47 node.dstar = param, self.dispatch(default)
1.48
1.49 # Add namespace details to any structure involved.
1.50
1.51 - if hasattr(node, "structure") and node.structure is not None:
1.52 + if node.structure is not None:
1.53
1.54 # Initialise bases where appropriate.
1.55