[pypy-svn] r18161 - pypy/dist/pypy/interpreter/pyparser
ac at codespeak.net
ac at codespeak.net
Tue Oct 4 20:10:36 CEST 2005
Author: ac
Date: Tue Oct 4 20:10:36 2005
New Revision: 18161
Modified:
pypy/dist/pypy/interpreter/pyparser/astbuilder.py
pypy/dist/pypy/interpreter/pyparser/pythonlexer.py
Log:
Give tokens correct lineno info.
Modified: pypy/dist/pypy/interpreter/pyparser/astbuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/astbuilder.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/astbuilder.py Tue Oct 4 20:10:36 2005
@@ -1615,10 +1615,10 @@
# print "\t", self.rule_stack
def push_tok(self, name, value, src ):
- self.push( TokenObject( name, value, src._lineno ) )
+ self.push( TokenObject( name, value, src._token_lnum ) )
def push_rule(self, name, count, src ):
- self.push( RuleObject( name, count, src._lineno ) )
+ self.push( RuleObject( name, count, src._token_lnum ) )
def alternative( self, rule, source ):
# Do nothing, keep rule on top of the stack
Modified: pypy/dist/pypy/interpreter/pyparser/pythonlexer.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/pythonlexer.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/pythonlexer.py Tue Oct 4 20:10:36 2005
@@ -296,6 +296,7 @@
self.token_stack = tokens
self._current_line = '' # the current line (as a string)
self._lineno = -1
+ self._token_lnum = 0
self._offset = 0
self.stack_pos = 0
@@ -307,6 +308,7 @@
self.stack_pos += 1
self._current_line = line
self._lineno = max(self._lineno, lnum)
+ self._token_lnum = lnum
self._offset = pos
return tok
More information about the Pypy-commit
mailing list