mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
gh-117411: move PyFutureFeatures to pycore_symtable.h and make it private (#117412)
This commit is contained in:
parent
5fd1897ec5
commit
1d5479b236
11 changed files with 49 additions and 42 deletions
|
@ -1,11 +1,12 @@
|
|||
#include "Python.h"
|
||||
#include "pycore_ast.h" // _PyAST_GetDocString()
|
||||
#include "pycore_symtable.h" // _PyFutureFeatures
|
||||
#include "pycore_unicodeobject.h" // _PyUnicode_EqualToASCIIString()
|
||||
|
||||
#define UNDEFINED_FUTURE_FEATURE "future feature %.100s is not defined"
|
||||
|
||||
static int
|
||||
future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename)
|
||||
future_check_features(_PyFutureFeatures *ff, stmt_ty s, PyObject *filename)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -53,7 +54,7 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, PyObject *filename)
|
|||
}
|
||||
|
||||
static int
|
||||
future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
|
||||
future_parse(_PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
|
||||
{
|
||||
if (!(mod->kind == Module_kind || mod->kind == Interactive_kind)) {
|
||||
return 1;
|
||||
|
@ -98,10 +99,10 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, PyObject *filename)
|
|||
|
||||
|
||||
int
|
||||
_PyFuture_FromAST(mod_ty mod, PyObject *filename, PyFutureFeatures *ff)
|
||||
_PyFuture_FromAST(mod_ty mod, PyObject *filename, _PyFutureFeatures *ff)
|
||||
{
|
||||
ff->ff_features = 0;
|
||||
ff->ff_location = (_PyCompilerSrcLocation){-1, -1, -1, -1};
|
||||
ff->ff_location = (_Py_SourceLocation){-1, -1, -1, -1};
|
||||
|
||||
if (!future_parse(ff, mod, filename)) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue