[pypy-svn] r14229 - in pypy/dist/pypy/interpreter: . pyparser
adim at codespeak.net
adim at codespeak.net
Mon Jul 4 17:54:33 CEST 2005
Author: adim
Date: Mon Jul 4 17:54:32 2005
New Revision: 14229
Modified:
pypy/dist/pypy/interpreter/pycompiler.py
pypy/dist/pypy/interpreter/pyparser/pythonlexer.py
Log:
quick (hack) fix for using incomplete inputs in interactive
interpreter when using the '--pyparse' option
Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py (original)
+++ pypy/dist/pypy/interpreter/pycompiler.py Mon Jul 4 17:54:32 2005
@@ -68,7 +68,7 @@
if not err2.match(space, space.w_SyntaxError):
raise
- if space.eq_w(err1.w_value, err2.w_value):
+ if mode != 'single' and space.eq_w(err1.w_value, err2.w_value):
raise # twice the same error, re-raise
return None # two different errors, expect more
Modified: pypy/dist/pypy/interpreter/pyparser/pythonlexer.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/pythonlexer.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/pythonlexer.py Mon Jul 4 17:54:32 2005
@@ -288,10 +288,12 @@
tok = token_from_values(tokenmod.DEDENT, '')
token_list.append((tok, line, lnum, pos))
# token_list.append((DEDENT, '', (lnum, 0), (lnum, 0), ''))
-
+ lnum += 1
+
## <XXX> adim
- token_list.append((Token('NEWLINE', ''), line, lnum, 0))
+ token_list.append((Token('NEWLINE', ''), '\n', lnum, 0))
## </XXX>
+ lnum += 1
tok = token_from_values(tokenmod.ENDMARKER, '',)
token_list.append((tok, line, lnum, pos))
# token_list.append((ENDMARKER, '', (lnum, 0), (lnum, 0), ''))
More information about the Pypy-commit
mailing list