[Python-checkins] CVS: /python/nondist/src/Compiler/p2c transformer.py,1.6,1.7
Jeremy Hylton
jhylton@cnri.reston.va.us
Tue, 15 Feb 2000 19:51:40 -0500
Update of /projects/cvsroot//python/nondist/src/Compiler/p2c
In directory goon.cnri.reston.va.us:/home/jhylton/python/nondist/src/Compiler/p2c
Modified Files:
transformer.py
Log Message:
more robust assignment of lineno for keyword args
get the lineno from the name of the keyword arg
example of case that didn't work--
def foo(x, y, a = None,
b = None):
Index: transformer.py
===================================================================
RCS file: /projects/cvsroot//python/nondist/src/Compiler/p2c/transformer.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** transformer.py 2000/02/15 23:43:19 1.6
--- transformer.py 2000/02/16 00:51:37 1.7
***************
*** 994,1000 ****
if n[0] != token.NAME:
raise SyntaxError, "keyword can't be an expression (%s)"%n[0]
! n = Node('keyword', n[1], result)
! n.lineno = result.lineno
! return 1, n
def com_subscriptlist(self, primary, nodelist, assigning):
--- 994,1000 ----
if n[0] != token.NAME:
raise SyntaxError, "keyword can't be an expression (%s)"%n[0]
! node = Node('keyword', n[1], result)
! node.lineno = n[2]
! return 1, node
def com_subscriptlist(self, primary, nodelist, assigning):