[Python-checkins] python/dist/src/Include parsetok.h,2.17.2.1,2.17.2.2 pythonrun.h,2.49,2.49.2.1

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Sun, 07 Jul 2002 11:18:20 -0700


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

Modified Files:
      Tag: ast-branch
	parsetok.h pythonrun.h 
Log Message:
Move PyParser_ASTFromString() and Filename() into pythonrun.h
where they interfere less with the parser.

Declare return value to be pointer to struct to avoid dependency on
Python-ast.h.

Make sure new interfaces use const where appopriate and chase this
partway into the parser.


Index: parsetok.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/parsetok.h,v
retrieving revision 2.17.2.1
retrieving revision 2.17.2.2
diff -C2 -d -r2.17.2.1 -r2.17.2.2
*** parsetok.h	7 Jul 2002 17:43:07 -0000	2.17.2.1
--- parsetok.h	7 Jul 2002 18:18:18 -0000	2.17.2.2
***************
*** 10,14 ****
  typedef struct {
      int error;
!     char *filename;
      int lineno;
      int offset;
--- 10,14 ----
  typedef struct {
      int error;
!     const char *filename;
      int lineno;
      int offset;
***************
*** 27,41 ****
                                               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);
- 
- extern DL_IMPORT(mod_ty) PyParser_ASTFromString(char *, char *, grammar *, 
- 						int, perrdetail *, int);
- extern DL_IMPORT(mod_ty) PyParser_ASTFromFile(FILE *, char *, grammar *,
- 					      int, char *, char *,
- 					      perrdetail *, int);
  #ifdef __cplusplus
  }
--- 27,36 ----
                                               char *, char *, perrdetail *);
  
! extern DL_IMPORT(node *) PyParser_ParseStringFlags(const char *, grammar *, 
! 						   int, perrdetail *, int);
! extern DL_IMPORT(node *) PyParser_ParseFileFlags(FILE *, const 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.49
retrieving revision 2.49.2.1
diff -C2 -d -r2.49 -r2.49.2.1
*** pythonrun.h	12 Apr 2002 01:20:10 -0000	2.49
--- pythonrun.h	7 Jul 2002 18:18:18 -0000	2.49.2.1
***************
*** 43,49 ****
  DL_IMPORT(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *);
  
  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);
--- 43,55 ----
  DL_IMPORT(int) PyRun_InteractiveLoopFlags(FILE *, char *, PyCompilerFlags *);
  
+ 
+ DL_IMPORT(struct _mod *) PyParser_ASTFromString(const char *, const char *, 
+ 						int, int);
+ DL_IMPORT(struct _mod *) PyParser_ASTFromFile(FILE *, const char *, int, 
+ 					      char *, char *, int);
  DL_IMPORT(struct _node *) PyParser_SimpleParseString(char *, int);
  DL_IMPORT(struct _node *) PyParser_SimpleParseFile(FILE *, char *, int);
! DL_IMPORT(struct _node *) PyParser_SimpleParseStringFlags(const char *, int, 
! 							  int);
  DL_IMPORT(struct _node *) PyParser_SimpleParseFileFlags(FILE *, char *,
  							int, int);