[pypy-svn] r16957 - in pypy/release/0.7.x/pypy: interpreter/stablecompiler lib/_stablecompiler

ludal at codespeak.net ludal at codespeak.net
Sun Aug 28 11:49:52 CEST 2005


Author: ludal
Date: Sun Aug 28 11:49:50 2005
New Revision: 16957

Modified:
   pypy/release/0.7.x/pypy/interpreter/stablecompiler/transformer.py
   pypy/release/0.7.x/pypy/lib/_stablecompiler/transformer.py
Log:
 correct some syntaxerror() calls


Modified: pypy/release/0.7.x/pypy/interpreter/stablecompiler/transformer.py
==============================================================================
--- pypy/release/0.7.x/pypy/interpreter/stablecompiler/transformer.py	(original)
+++ pypy/release/0.7.x/pypy/interpreter/stablecompiler/transformer.py	Sun Aug 28 11:49:50 2005
@@ -1210,11 +1210,11 @@
         if t == token.LSQB:
             return self.com_subscriptlist(primaryNode, nodelist[2], OP_APPLY)
 
-        self.syntaxerror( 'unknown node type: %s' % t, primaryNode)
+        self.syntaxerror( 'unknown node type: %s' % t, nodelist[1])
 
     def com_select_member(self, primaryNode, nodelist):
         if nodelist[0] != token.NAME:
-            self.syntaxerror( "member must be a name", primaryNode)
+            self.syntaxerror( "member must be a name", nodelist[0])
         return Getattr(primaryNode, nodelist[1], lineno=nodelist[2])
 
     def com_call_function(self, primaryNode, nodelist):
@@ -1233,7 +1233,7 @@
                and len(node) == 3 and node[2][0] == symbol.gen_for:
                 # allow f(x for x in y), but reject f(x for x in y, 1)
                 # should use f((x for x in y), 1) instead of f(x for x in y, 1)
-                self.syntaxerror( 'generator expression needs parenthesis', primaryNode)
+                self.syntaxerror( 'generator expression needs parenthesis', nodelist[0])
 
             args.append(result)
         else:
@@ -1249,14 +1249,14 @@
             i = i + 3
             if tok[0]==token.STAR:
                 if star_node is not None:
-                    self.syntaxerror( 'already have the varargs indentifier', primaryNode)
+                    self.syntaxerror( 'already have the varargs indentifier', nodelist[0] )
                 star_node = self.com_node(ch)
             elif tok[0]==token.DOUBLESTAR:
                 if dstar_node is not None:
-                    self.syntaxerror( 'already have the kwargs indentifier', primaryNode)
+                    self.syntaxerror( 'already have the kwargs indentifier', nodelist[0] )
                 dstar_node = self.com_node(ch)
             else:
-                self.syntaxerror( 'unknown node type: %s' % tok, primaryNode)
+                self.syntaxerror( 'unknown node type: %s' % tok, nodelist[0] )
         return CallFunc(primaryNode, args, star_node, dstar_node,
                         lineno=extractLineNo(nodelist))
 

Modified: pypy/release/0.7.x/pypy/lib/_stablecompiler/transformer.py
==============================================================================
--- pypy/release/0.7.x/pypy/lib/_stablecompiler/transformer.py	(original)
+++ pypy/release/0.7.x/pypy/lib/_stablecompiler/transformer.py	Sun Aug 28 11:49:50 2005
@@ -1206,11 +1206,11 @@
         if t == token.LSQB:
             return self.com_subscriptlist(primaryNode, nodelist[2], OP_APPLY)
 
-        self.syntaxerror( 'unknown node type: %s' % t, primaryNode)
+        self.syntaxerror( 'unknown node type: %s' % t, nodelist[1])
 
     def com_select_member(self, primaryNode, nodelist):
         if nodelist[0] != token.NAME:
-            self.syntaxerror( "member must be a name", primaryNode)
+            self.syntaxerror( "member must be a name", nodelist[0])
         return Getattr(primaryNode, nodelist[1], lineno=nodelist[2])
 
     def com_call_function(self, primaryNode, nodelist):
@@ -1229,7 +1229,7 @@
                and len(node) == 3 and node[2][0] == symbol.gen_for:
                 # allow f(x for x in y), but reject f(x for x in y, 1)
                 # should use f((x for x in y), 1) instead of f(x for x in y, 1)
-                self.syntaxerror( 'generator expression needs parenthesis', primaryNode)
+                self.syntaxerror( 'generator expression needs parenthesis', nodelist[0])
 
             args.append(result)
         else:
@@ -1245,14 +1245,14 @@
             i = i + 3
             if tok[0]==token.STAR:
                 if star_node is not None:
-                    self.syntaxerror( 'already have the varargs indentifier', primaryNode)
+                    self.syntaxerror( 'already have the varargs indentifier', nodelist[0] )
                 star_node = self.com_node(ch)
             elif tok[0]==token.DOUBLESTAR:
                 if dstar_node is not None:
-                    self.syntaxerror( 'already have the kwargs indentifier', primaryNode)
+                    self.syntaxerror( 'already have the kwargs indentifier', nodelist[0] )
                 dstar_node = self.com_node(ch)
             else:
-                self.syntaxerror( 'unknown node type: %s' % tok, primaryNode)
+                self.syntaxerror( 'unknown node type: %s' % tok, nodelist[0] )
         return CallFunc(primaryNode, args, star_node, dstar_node,
                         lineno=extractLineNo(nodelist))
 



More information about the Pypy-commit mailing list