[Python-checkins] CVS: python/dist/src/Include Python.h,2.32.2.2,2.32.2.3 ceval.h,2.41.4.2,2.41.4.3 compile.h,2.29.4.2,2.29.4.3 parsetok.h,2.15,2.15.8.1 pythonrun.h,2.41.4.1,2.41.4.2

Tim Peters tim_one@users.sourceforge.net
Mon, 16 Jul 2001 14:38:11 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv11200/descr/dist/src/Include

Modified Files:
      Tag: descr-branch
	Python.h ceval.h compile.h parsetok.h pythonrun.h 
Log Message:
Resuming interrupted merge checkin.


Index: Python.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v
retrieving revision 2.32.2.2
retrieving revision 2.32.2.3
diff -C2 -r2.32.2.2 -r2.32.2.3
*** Python.h	2001/07/15 20:26:55	2.32.2.2
--- Python.h	2001/07/16 21:38:09	2.32.2.3
***************
*** 98,103 ****
  
  #include "modsupport.h"
- #include "ceval.h"
  #include "pythonrun.h"
  #include "sysmodule.h"
  #include "intrcheck.h"
--- 98,103 ----
  
  #include "modsupport.h"
  #include "pythonrun.h"
+ #include "ceval.h"
  #include "sysmodule.h"
  #include "intrcheck.h"

Index: ceval.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v
retrieving revision 2.41.4.2
retrieving revision 2.41.4.3
diff -C2 -r2.41.4.2 -r2.41.4.3
*** ceval.h	2001/07/07 22:55:27	2.41.4.2
--- ceval.h	2001/07/16 21:38:09	2.41.4.3
***************
*** 32,36 ****
  DL_IMPORT(PyObject *) PyEval_GetFrame(void);
  DL_IMPORT(int) PyEval_GetRestricted(void);
! DL_IMPORT(int) PyEval_GetNestedScopes(void);
  
  DL_IMPORT(int) Py_FlushLine(void);
--- 32,40 ----
  DL_IMPORT(PyObject *) PyEval_GetFrame(void);
  DL_IMPORT(int) PyEval_GetRestricted(void);
! 
! /* Look at the current frame's (if any) code's co_flags, and turn on
!    the corresponding compiler flags in cf->cf_flags.  Return 1 if any
!    flag was set, else return 0. */
! DL_IMPORT(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
  
  DL_IMPORT(int) Py_FlushLine(void);

Index: compile.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v
retrieving revision 2.29.4.2
retrieving revision 2.29.4.3
diff -C2 -r2.29.4.2 -r2.29.4.3
*** compile.h	2001/07/14 07:47:34	2.29.4.2
--- compile.h	2001/07/16 21:38:09	2.29.4.3
***************
*** 35,38 ****
--- 35,45 ----
  #define CO_NESTED       0x0010
  #define CO_GENERATOR    0x0020
+ /* XXX Temporary hack.  Until generators are a permanent part of the
+    language, we need a way for a code object to record that generators
+    were *possible* when it was compiled.  This is so code dynamically
+    compiled *by* a code object knows whether to allow yield stmts.  In
+    effect, this passes on the "from __future__ import generators" state
+    in effect when the code block was compiled. */
+ #define CO_GENERATOR_ALLOWED    0x1000
  
  extern DL_IMPORT(PyTypeObject) PyCode_Type;
***************
*** 57,60 ****
--- 64,68 ----
      int ff_last_lineno;
      int ff_nested_scopes;
+     int ff_generators;
  } PyFutureFeatures;
  
***************
*** 65,68 ****
--- 73,79 ----
  #define NESTED_SCOPES_DEFAULT 1
  #define FUTURE_NESTED_SCOPES "nested_scopes"
+ 
+ #define GENERATORS_DEFAULT 0
+ #define FUTURE_GENERATORS "generators"
  
  /* for internal use only */

Index: parsetok.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/parsetok.h,v
retrieving revision 2.15
retrieving revision 2.15.8.1
diff -C2 -r2.15 -r2.15.8.1
*** parsetok.h	2000/09/01 23:29:26	2.15
--- parsetok.h	2001/07/16 21:38:09	2.15.8.1
***************
*** 18,25 ****
--- 18,33 ----
  } perrdetail;
  
+ #define PyPARSE_YIELD_IS_KEYWORD	0x0001
+ 
  extern DL_IMPORT(node *) PyParser_ParseString(char *, grammar *, int,
                                                perrdetail *);
  extern DL_IMPORT(node *) PyParser_ParseFile (FILE *, char *, grammar *, int,
                                               char *, char *, perrdetail *);
+ 
+ extern DL_IMPORT(node *) PyParser_ParseStringFlags(char *, grammar *, int,
+                                               perrdetail *, int);
+ extern DL_IMPORT(node *) PyParser_ParseFileFlags(FILE *, char *, grammar *,
+ 						 int, char *, char *,
+ 						 perrdetail *, int);
  
  #ifdef __cplusplus

Index: pythonrun.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v
retrieving revision 2.41.4.1
retrieving revision 2.41.4.2
diff -C2 -r2.41.4.1 -r2.41.4.2
*** pythonrun.h	2001/06/28 16:15:37	2.41.4.1
--- pythonrun.h	2001/07/16 21:38:09	2.41.4.2
***************
*** 8,13 ****
  #endif
  
  typedef struct {
! 	int cf_nested_scopes;
  } PyCompilerFlags;
  
--- 8,18 ----
  #endif
  
+ /* These flags are named after the __future__ statements that introduced
+    them.  May not remain true for later additions, so fiddle this comment
+    accordingly then. */
+ #define PyCF_NESTED_SCOPES	(0x00000001UL)
+ #define PyCF_GENERATORS		(0x00000002UL)
  typedef struct {
! 	unsigned long cf_flags;  /* bitmask of PyCF_xxx flags */
  } PyCompilerFlags;
  
***************
*** 41,44 ****
--- 46,52 ----
  DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
  DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
+ DL_IMPORT(struct _node *) PyParser_SimpleParseStringFlags(char *, int, int);
+ DL_IMPORT(struct _node *) PyParser_SimpleParseFileFlags(FILE *, char *,
+ 							int, int);
  
  DL_IMPORT(PyObject *) PyRun_String(char *, int, PyObject *, PyObject *);