[Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.45,1.46
Jeremy Hylton
jhylton@users.sourceforge.net
Wed, 29 Aug 2001 13:57:45 -0700
Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv9318
Modified Files:
pycodegen.py
Log Message:
Generate SET_LINENO for list and tuple literals when the open paren
starts a new line.
Also fix undetected typo in visitDict() -- uncovered by recent change
to add lineno attrs to atoms.
Index: pycodegen.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** pycodegen.py 2001/08/29 18:14:39 1.45
--- pycodegen.py 2001/08/29 20:57:43 1.46
***************
*** 954,957 ****
--- 954,958 ----
def visitTuple(self, node):
+ self.set_lineno(node)
for elt in node.nodes:
self.visit(elt)
***************
*** 959,962 ****
--- 960,964 ----
def visitList(self, node):
+ self.set_lineno(node)
for elt in node.nodes:
self.visit(elt)
***************
*** 971,975 ****
lineno = getattr(node, 'lineno', None)
if lineno:
! set.emit('SET_LINENO', lineno)
self.emit('BUILD_MAP', 0)
for k, v in node.items:
--- 973,977 ----
lineno = getattr(node, 'lineno', None)
if lineno:
! self.emit('SET_LINENO', lineno)
self.emit('BUILD_MAP', 0)
for k, v in node.items: