[Python-checkins] CVS: python/dist/src/Include symtable.h,2.4,2.5 compile.h,2.25,2.26
Jeremy Hylton
jhylton@users.sourceforge.net
Tue, 27 Feb 2001 11:07:04 -0800
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv27842/Include
Modified Files:
symtable.h compile.h
Log Message:
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
Index: symtable.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/symtable.h,v
retrieving revision 2.4
retrieving revision 2.5
diff -C2 -r2.4 -r2.5
*** symtable.h 2001/02/27 04:23:34 2.4
--- symtable.h 2001/02/27 19:07:02 2.5
***************
*** 31,34 ****
--- 31,35 ----
char *st_private; /* name of current class or NULL */
int st_tmpname; /* temporary name counter */
+ PyFutureFeatures *st_future; /* module's future features */
};
Index: compile.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v
retrieving revision 2.25
retrieving revision 2.26
diff -C2 -r2.25 -r2.26
*** compile.h 2001/02/27 04:23:34 2.25
--- compile.h 2001/02/27 19:07:02 2.26
***************
*** 8,14 ****
#endif
- #define NESTED_SCOPES_DEFAULT 0
- #define FUTURE_NESTED_SCOPES "nested_scopes"
-
/* Bytecode object */
typedef struct {
--- 8,11 ----
***************
*** 51,54 ****
--- 48,64 ----
/* 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 */