mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Improved __future__ parser; still more to do
Makefile.pre.in: add target future.o Include/compile.h: define PyFutureFeaters and PyNode_Future() add c_future slot to struct compiling Include/symtable.h: add st_future slot to struct symtable Python/future.c: implementation of PyNode_Future() Python/compile.c: use PyNode_Future() for nested_scopes support Python/symtable.c: include compile.h to pick up PyFutureFeatures decl
This commit is contained in:
parent
ed5e8234d7
commit
4db62b1e14
6 changed files with 167 additions and 46 deletions
|
@ -7,9 +7,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NESTED_SCOPES_DEFAULT 0
|
||||
#define FUTURE_NESTED_SCOPES "nested_scopes"
|
||||
|
||||
/* Bytecode object */
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
|
@ -51,6 +48,19 @@ DL_IMPORT(PyCodeObject *) PyCode_New(
|
|||
/* same as struct above */
|
||||
DL_IMPORT(int) PyCode_Addr2Line(PyCodeObject *, int);
|
||||
|
||||
/* Future feature support */
|
||||
|
||||
typedef struct {
|
||||
int ff_last_lineno;
|
||||
int ff_n_simple_stmt;
|
||||
int ff_nested_scopes;
|
||||
} PyFutureFeatures;
|
||||
|
||||
DL_IMPORT(PyFutureFeatures *) PyNode_Future(struct _node *, char *);
|
||||
|
||||
#define NESTED_SCOPES_DEFAULT 0
|
||||
#define FUTURE_NESTED_SCOPES "nested_scopes"
|
||||
|
||||
/* for internal use only */
|
||||
#define _PyCode_GETCODEPTR(co, pp) \
|
||||
((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue