[pypy-svn] r14244 - pypy/dist/pypy/interpreter/pyparser

adim at codespeak.net adim at codespeak.net
Mon Jul 4 20:51:03 CEST 2005


Author: adim
Date: Mon Jul  4 20:51:01 2005
New Revision: 14244

Modified:
   pypy/dist/pypy/interpreter/pyparser/tuplebuilder.py
Log:
linenos should always be present in Terminal objects. The fact that we
sometimes don't want linenos in the nested tuples must be an option
of as_tuple() and nothing else.



Modified: pypy/dist/pypy/interpreter/pyparser/tuplebuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/tuplebuilder.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/tuplebuilder.py	Mon Jul  4 20:51:01 2005
@@ -88,14 +88,11 @@
 
     def token(self, name, value, source):
         num = TOKEN_MAP.get(name, -1)
-        lineno = source.current_line()
+        lineno = source.current_lineno()
         if value is None:
             if name not in ("NEWLINE", "INDENT", "DEDENT", "ENDMARKER"):
                 value = name
             else:
                 value = ''
-        if self.lineno:
-            self.stack.append( Terminal(num, value, lineno) )
-        else:
-            self.stack.append( Terminal(num, value, -1) )
+        self.stack.append( Terminal(num, value, lineno) )
         return True



More information about the Pypy-commit mailing list