1.1 --- a/fixnames.py Sat Oct 07 00:23:47 2006 +0200
1.2 +++ b/fixnames.py Sat Oct 07 01:48:39 2006 +0200
1.3 @@ -247,7 +247,13 @@
1.4 # For structure namespaces, load an attribute.
1.5
1.6 if scope == "structure":
1.7 - result = self.dispatch(LoadAttr(expr=LoadRef(ref=self.namespace.structure), name=loadname.name, nstype="structure"))
1.8 + result = self.dispatch(
1.9 + LoadAttr(loadname.original,
1.10 + expr=LoadRef(loadname.original,
1.11 + ref=self.namespace.structure),
1.12 + name=loadname.name,
1.13 + nstype="structure")
1.14 + )
1.15
1.16 # For global accesses (ie. those outside the local namespace)...
1.17
1.18 @@ -262,19 +268,37 @@
1.19 # built-in.
1.20
1.21 if scope == "global":
1.22 - result = self.dispatch(LoadAttr(expr=LoadRef(ref=self.builtins), name=loadname.name, nstype="module"))
1.23 + result = self.dispatch(
1.24 + LoadAttr(loadname.original,
1.25 + expr=LoadRef(loadname.original,
1.26 + ref=self.builtins),
1.27 + name=loadname.name,
1.28 + nstype="module")
1.29 + )
1.30
1.31 # Otherwise, it is within the global namespace and must be a
1.32 # global.
1.33
1.34 else:
1.35 - result = self.dispatch(LoadAttr(expr=LoadRef(ref=self.module), name=loadname.name, nstype="module"))
1.36 + result = self.dispatch(
1.37 + LoadAttr(loadname.original,
1.38 + expr=LoadRef(loadname.original,
1.39 + ref=self.module),
1.40 + name=loadname.name,
1.41 + nstype="module")
1.42 + )
1.43
1.44 # Where no global namespace exists, we are at the module level and
1.45 # must be accessing a built-in.
1.46
1.47 else:
1.48 - result = self.dispatch(LoadAttr(expr=LoadRef(ref=self.builtins), name=loadname.name, nstype="module"))
1.49 + result = self.dispatch(
1.50 + LoadAttr(loadname.original,
1.51 + expr=LoadRef(loadname.original,
1.52 + ref=self.builtins),
1.53 + name=loadname.name,
1.54 + nstype="module")
1.55 + )
1.56
1.57 # For local accesses...
1.58
1.59 @@ -289,7 +313,13 @@
1.60 # module level).
1.61
1.62 else:
1.63 - result = self.dispatch(LoadAttr(expr=LoadRef(ref=self.module), name=loadname.name, nstype="module"))
1.64 + result = self.dispatch(
1.65 + LoadAttr(loadname.original,
1.66 + expr=LoadRef(loadname.original,
1.67 + ref=self.module),
1.68 + name=loadname.name,
1.69 + nstype="module")
1.70 + )
1.71
1.72 return result
1.73
1.74 @@ -302,13 +332,27 @@
1.75 # For structure namespaces, store an attribute.
1.76
1.77 if scope == "structure":
1.78 - return self.dispatch(StoreAttr(lvalue=LoadRef(ref=self.namespace.structure), name=storename.name, expr=storename.expr, nstype="structure"))
1.79 + return self.dispatch(
1.80 + StoreAttr(storename.original,
1.81 + lvalue=LoadRef(storename.original,
1.82 + ref=self.namespace.structure),
1.83 + name=storename.name,
1.84 + expr=storename.expr,
1.85 + nstype="structure")
1.86 + )
1.87
1.88 # Where the name is outside the local namespace, disallow any built-in
1.89 # assignment and store the name globally.
1.90
1.91 elif scope == "global":
1.92 - return self.dispatch(StoreAttr(lvalue=LoadRef(ref=self.module), name=storename.name, expr=storename.expr, nstype="module"))
1.93 + return self.dispatch(
1.94 + StoreAttr(storename.original,
1.95 + lvalue=LoadRef(storename.original,
1.96 + ref=self.module),
1.97 + name=storename.name,
1.98 + expr=storename.expr,
1.99 + nstype="module")
1.100 + )
1.101
1.102 # For local namespace accesses...
1.103
1.104 @@ -324,7 +368,14 @@
1.105 # considered global.
1.106
1.107 else:
1.108 - return self.dispatch(StoreAttr(lvalue=LoadRef(ref=self.module), name=storename.name, expr=storename.expr, nstype="module"))
1.109 + return self.dispatch(
1.110 + StoreAttr(storename.original,
1.111 + lvalue=LoadRef(storename.original,
1.112 + ref=self.module),
1.113 + name=storename.name,
1.114 + expr=storename.expr,
1.115 + nstype="module")
1.116 + )
1.117
1.118 def visitInvokeFunction(self, invoke):
1.119