[pypy-commit] lang-js default: fix repl error handling

stepahn noreply at buildbot.pypy.org
Fri Dec 28 11:35:42 CET 2012


Author: Stephan <stephan at stzal.com>
Branch: 
Changeset: r320:cc682c3cb2c5
Date: 2012-12-11 22:45 +0100
http://bitbucket.org/pypy/lang-js/changeset/cc682c3cb2c5/

Log:	fix repl error handling

diff --git a/js/py-js.py b/js/py-js.py
--- a/js/py-js.py
+++ b/js/py-js.py
@@ -72,7 +72,7 @@
 
 def print_sourcepos(filename, source_pos, source):
     marker_indent = u' ' * source_pos.columnno
-    error_lineno = source_pos.lineno
+    error_lineno = source_pos.lineno - 1
     error_line = (source.splitlines())[error_lineno]
     printmessage(u'Syntax Error in: %s:%d\n' % (unicode(filename), error_lineno))
     printmessage(u'%s\n' % (unicode(error_line)))


More information about the pypy-commit mailing list