1.1 --- a/simplify/fixinstances.py Sun Jul 29 23:29:19 2007 +0200
1.2 +++ b/simplify/fixinstances.py Mon Jul 30 00:35:54 2007 +0200
1.3 @@ -83,7 +83,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 for specialised in subprogram.active():
1.10 self.process_node(specialised)
1.11
2.1 --- a/simplify/fixnames.py Sun Jul 29 23:29:19 2007 +0200
2.2 +++ b/simplify/fixnames.py Mon Jul 30 00:35:54 2007 +0200
2.3 @@ -127,7 +127,7 @@
2.4 # Internal subprograms are skipped here and processed specially via
2.5 # Invoke nodes.
2.6
2.7 - if not getattr(subprogram, "internal", 0):
2.8 + if not subprogram.internal:
2.9 self.subprograms.add(self.process_node(subprogram))
2.10
2.11 # Ultimately, we redefine the list of subprograms on the visitor.
2.12 @@ -149,7 +149,7 @@
2.13
2.14 # Obtain a namespace either based on locals or on a structure.
2.15
2.16 - structure = structure=getattr(node, "structure", None)
2.17 + structure = node.structure
2.18
2.19 # If passed some namespace, use that as the current namespace.
2.20
2.21 @@ -167,29 +167,29 @@
2.22 # NOTE: subprogram within itself. Do not define the name of the function
2.23 # NOTE: within a method definition.
2.24
2.25 - if isinstance(node, Subprogram) and getattr(node, "name", None) is not None and not getattr(node, "is_method", 0):
2.26 + if isinstance(node, Subprogram) and node.name is not None and not node.is_method:
2.27 self.namespace.store(node.name)
2.28
2.29 # Register the names of parameters in the namespace.
2.30
2.31 - if hasattr(node, "params"):
2.32 + if node.params:
2.33 new_params = []
2.34 for param, default in node.params:
2.35 new_params.append((param, self.dispatch(default)))
2.36 self.namespace.store(param)
2.37 node.params = new_params
2.38 - if getattr(node, "star", None):
2.39 + if node.star:
2.40 param, default = node.star
2.41 self.namespace.store(param)
2.42 node.star = param, self.dispatch(default)
2.43 - if getattr(node, "dstar", None):
2.44 + if node.dstar:
2.45 param, default = node.dstar
2.46 self.namespace.store(param)
2.47 node.dstar = param, self.dispatch(default)
2.48
2.49 # Add namespace details to any structure involved.
2.50
2.51 - if hasattr(node, "structure") and node.structure is not None:
2.52 + if node.structure is not None:
2.53
2.54 # Initialise bases where appropriate.
2.55
3.1 --- a/simplify/simplified/program.py Sun Jul 29 23:29:19 2007 +0200
3.2 +++ b/simplify/simplified/program.py Mon Jul 30 00:35:54 2007 +0200
3.3 @@ -452,6 +452,9 @@
3.4 def __init__(self, *args, **kw):
3.5 Node.__init__(self, *args, **kw)
3.6 self.structure = None
3.7 + self.params = []
3.8 + self.star = None
3.9 + self.dstar = None
3.10
3.11 def full_name(self):
3.12 return "module %s" % self.name