Improve SyntaxErrors for bad future statements. Set file and location

for errors raised in future.c.

Move some helper functions from compile.c to errors.c and make them
API functions: PyErr_SyntaxLocation() and PyErr_ProgramText().
This commit is contained in:
Jeremy Hylton 2001-02-28 17:47:12 +00:00
parent 5687ffe0c5
commit ad3d3f2f3f
4 changed files with 113 additions and 94 deletions

View file

@ -98,6 +98,10 @@ extern DL_IMPORT(int) PyErr_Warn(PyObject *, char *);
/* In sigcheck.c or signalmodule.c */
extern DL_IMPORT(int) PyErr_CheckSignals(void);
extern DL_IMPORT(void) PyErr_SetInterrupt(void);
/* Support for adding program text to SyntaxErrors */
extern DL_IMPORT(void) PyErr_SyntaxLocation(char *, int);
extern DL_IMPORT(PyObject *) PyErr_ProgramText(char *, int);
#ifdef __cplusplus