cpython/Python
Jeremy Hylton 9f1b9932b8 Print the offending line of code in the traceback for SyntaxErrors
raised by the compiler.

XXX For now, text entered into the interactive intepreter is not
printed in the traceback.

Inspired by a patch from Roman Sulzhyk

compile.c:

Add helper fetch_program_text() that opens a file and reads until it
finds the specified line number.  The code is a near duplicate of
similar code in traceback.c.

Modify com_error() to pass two arguments to SyntaxError constructor,
where the second argument contains the offending text when possible.

Modify set_error_location(), now used only by the symtable pass, to
set the text attribute on existing exceptions.

pythonrun.c:

Change parse_syntax_error() to continue of the offset attribute of a
SyntaxError is None.  In this case, it sets offset to -1.

Move code from PyErr_PrintEx() into helper function
print_error_text().  In the helper, only print the caret for a
SyntaxError if offset > 0.
2001-02-28 07:07:43 +00:00
..
.cvsignore
atof.c
bltinmodule.c Backed out the unistr() builtin. 2001-01-19 21:36:19 +00:00
ceval.c Remove trailing comma from 'why_code' enum, which was introduced by the 2001-02-16 11:52:31 +00:00
codecs.c Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
compile.c Print the offending line of code in the traceback for SyntaxErrors 2001-02-28 07:07:43 +00:00
dup2.c
dynload_aix.c
dynload_beos.c
dynload_dl.c
dynload_hpux.c
dynload_mac.c Use #if TARGET_API_MAC_CARBON to determine carbon/classic macos, not #ifdef. 2001-01-19 23:34:06 +00:00
dynload_next.c
dynload_os2.c
dynload_shlib.c Oops, one more part of the cygwin patch (SF patch #102409 by jlt63: 2001-01-10 21:17:27 +00:00
dynload_stub.c
dynload_win.c Detect conflicting Python DLL on module import under Windows - as per [ Patch #101676 ] 2000-10-05 10:54:45 +00:00
errors.c Add PyErr_Warn(). 2000-12-15 21:58:52 +00:00
exceptions.c Leak pluggin', bug fixin' and better documentin'. Specifically, 2001-01-23 16:08:34 +00:00
fmod.c
frozen.c
frozenmain.c
future.c Need to support single_input explicitly so from __future__ imports 2001-02-28 02:26:14 +00:00
getargs.c Related to SF bug 132008 (PyList_Reverse blows up). 2001-02-12 22:13:26 +00:00
getcompiler.c
getcopyright.c Add my name to the copyright notice. 2001-01-18 14:50:11 +00:00
getcwd.c
getmtime.c Move distributed and duplicated config for stat() and fstat() into pyport.h. 2001-01-18 03:03:16 +00:00
getopt.c Move our own getopt() implementation to _PyOS_GetOpt(), and use it 2000-11-03 08:18:37 +00:00
getplatform.c
getversion.c
graminit.c
hypot.c
import.c Ack -- my eyes are getting bleary. Typos in the comment typo repairs. 2001-02-28 05:57:51 +00:00
importdl.c
importdl.h
marshal.c It's unclear whether PyMarshal_XXX() are part of the public or private API. 2001-01-28 00:27:39 +00:00
memmove.c
modsupport.c Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
mystrtoul.c
pyfpe.c
pystate.c Add a new API, PyThreadState_DeleteCurrent() that combines 2001-01-23 01:46:06 +00:00
pythonmain.c
pythonrun.c Print the offending line of code in the traceback for SyntaxErrors 2001-02-28 07:07:43 +00:00
sigcheck.c
strdup.c
strerror.c
strtod.c
structmember.c SF bug http://sourceforge.net/bugs/?func=detailbug&bug_id=130242&group_id=5470 2001-01-27 06:20:08 +00:00
symtable.c Improved __future__ parser; still more to do 2001-02-27 19:07:02 +00:00
sysmodule.c Neil discovered a bad DECREF on warnoptions, that caused repeated 2001-01-13 22:06:05 +00:00
thread.c Donn Cave <donn@u.washington.edu>: 2000-10-06 15:48:38 +00:00
thread_beos.h
thread_cthread.h Fix syntax error. Submitted by Bill Bumgarner. Apparently this is 2000-11-13 19:45:45 +00:00
thread_foobar.h
thread_lwp.h
thread_nt.h
thread_os2.h
thread_pth.h Andy Dustman <adustman@users.sourceforge.net>: 2000-10-12 20:58:32 +00:00
thread_pthread.h
thread_sgi.h
thread_solaris.h
thread_wince.h
traceback.c