diff Python/bltinmodule.c @ 5438:e926c331ebbf legacy-trunk

Instead of importing graminit.h whenever one of the three grammar 'root' symbols is needed, define these in Python.h with a Py_ prefix.
author Guido van Rossum <guido@python.org>
date Wed, 07 May 1997 17:46:13 +0000
parents dacbfaa07c40
children 8e5d6d3103ae
line wrap: on
line diff
--- a/Python/bltinmodule.c	Wed May 07 17:42:41 1997 +0000
+++ b/Python/bltinmodule.c	Wed May 07 17:46:13 1997 +0000
@@ -34,7 +34,6 @@
 #include "Python.h"
 
 #include "node.h"
-#include "graminit.h"
 #include "compile.h"
 #include "eval.h"
 
@@ -283,11 +282,11 @@
 	if (!PyArg_ParseTuple(args, "sss:compile", &str, &filename, &startstr))
 		return NULL;
 	if (strcmp(startstr, "exec") == 0)
-		start = file_input;
+		start = Py_file_input;
 	else if (strcmp(startstr, "eval") == 0)
-		start = eval_input;
+		start = Py_eval_input;
 	else if (strcmp(startstr, "single") == 0)
-		start = single_input;
+		start = Py_single_input;
 	else {
 		PyErr_SetString(PyExc_ValueError,
 		   "compile() mode must be 'exec' or 'eval' or 'single'");
@@ -521,7 +520,7 @@
 	}
 	while (*str == ' ' || *str == '\t')
 		str++;
-	return PyRun_String(str, eval_input, globals, locals);
+	return PyRun_String(str, Py_eval_input, globals, locals);
 }
 
 static PyObject *
@@ -558,7 +557,7 @@
 		PyErr_SetFromErrno(PyExc_IOError);
 		return NULL;
 	}
-	res = PyRun_File(fp, filename, file_input, globals, locals);
+	res = PyRun_File(fp, filename, Py_file_input, globals, locals);
 	Py_BEGIN_ALLOW_THREADS
 	fclose(fp);
 	Py_END_ALLOW_THREADS
@@ -882,7 +881,7 @@
 					 PyEval_GetBuiltins()) != 0)
 			return NULL;
 	}
-	res = PyRun_String(str, eval_input, globals, locals);
+	res = PyRun_String(str, Py_eval_input, globals, locals);
 	Py_DECREF(line);
 	return res;
 }