[Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.44,1.45

Jeremy Hylton jhylton@users.sourceforge.net
2001年8月29日 11:14:42 -0700


Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv17703
Modified Files:
	pycodegen.py 
Log Message:
Support // and //=
Generate SET_LINENO for del statements.
Define klass=1 for PyFlowGraph constructor for a class statement. A
class has no varnames.
Index: pycodegen.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** pycodegen.py	2001年08月28日 17:28:33	1.44
--- pycodegen.py	2001年08月29日 18:14:39	1.45
***************
*** 672,675 ****
--- 672,676 ----
 self.storeName(node.name)
 elif node.flags == 'OP_DELETE':
+ self.set_lineno(node)
 self.delName(node.name)
 else:
***************
*** 717,720 ****
--- 718,722 ----
 '*=' : 'INPLACE_MULTIPLY',
 '/=' : 'INPLACE_DIVIDE',
+ '//=': 'INPLACE_FLOOR_DIVIDE',
 '%=' : 'INPLACE_MODULO',
 '**=': 'INPLACE_POWER',
***************
*** 890,893 ****
--- 892,898 ----
 return self.binaryOp(node, 'BINARY_DIVIDE')
 
+ def visitFloorDiv(self, node):
+ return self.binaryOp(node, 'BINARY_FLOOR_DIVIDE')
+ 
 def visitMod(self, node):
 return self.binaryOp(node, 'BINARY_MODULO')
***************
*** 1169,1173 ****
 self.class_name = klass.name
 self.graph = pyassem.PyFlowGraph(klass.name, filename,
! optimized=0)
 self.super_init(filename)
 lnf = walk(klass.code, self.NameFinder(), verbose=0)
--- 1174,1178 ----
 self.class_name = klass.name
 self.graph = pyassem.PyFlowGraph(klass.name, filename,
! optimized=0, klass=1)
 self.super_init(filename)
 lnf = walk(klass.code, self.NameFinder(), verbose=0)

AltStyle によって変換されたページ (->オリジナル) /