XXX_NAME ops should affect varnames

varnames should list all the local variables (with arguments first).
The XXX_NAME ops typically occur at the module level and assignment
ops should create locals.
This commit is contained in:
Jeremy Hylton 2001-08-28 16:36:12 +00:00
parent f354575328
commit 63db7b9ca1
2 changed files with 10 additions and 4 deletions

View File

@ -491,9 +491,12 @@ class PyFlowGraph(FlowGraph):
_convert_STORE_FAST = _convert_LOAD_FAST
_convert_DELETE_FAST = _convert_LOAD_FAST
def _convert_NAME(self, arg):
def _convert_LOAD_NAME(self, arg):
return self._lookupName(arg, self.names)
def _convert_NAME(self, arg):
self._lookupName(arg, self.varnames)
return self._lookupName(arg, self.names)
_convert_LOAD_NAME = _convert_NAME
_convert_STORE_NAME = _convert_NAME
_convert_DELETE_NAME = _convert_NAME
_convert_IMPORT_NAME = _convert_NAME

View File

@ -491,9 +491,12 @@ class PyFlowGraph(FlowGraph):
_convert_STORE_FAST = _convert_LOAD_FAST
_convert_DELETE_FAST = _convert_LOAD_FAST
def _convert_NAME(self, arg):
def _convert_LOAD_NAME(self, arg):
return self._lookupName(arg, self.names)
def _convert_NAME(self, arg):
self._lookupName(arg, self.varnames)
return self._lookupName(arg, self.names)
_convert_LOAD_NAME = _convert_NAME
_convert_STORE_NAME = _convert_NAME
_convert_DELETE_NAME = _convert_NAME
_convert_IMPORT_NAME = _convert_NAME