mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Implement tree-shaking for Python sources
This commit is contained in:
parent
81287b7ec0
commit
44c87b83ff
110 changed files with 899 additions and 1922 deletions
6
third_party/python/Python/Python-ast.c
generated
vendored
6
third_party/python/Python/Python-ast.c
generated
vendored
|
@ -17,8 +17,11 @@
|
|||
#include "third_party/python/Include/pyerrors.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
#include "third_party/python/Include/tupleobject.h"
|
||||
#include "third_party/python/Include/yoink.h"
|
||||
/* clang-format off */
|
||||
|
||||
PYTHON_PROVIDE("_ast");
|
||||
|
||||
/* File automatically generated by Parser/asdl_c.py. */
|
||||
|
||||
static PyTypeObject AST_type;
|
||||
|
@ -7862,6 +7865,7 @@ failed:
|
|||
static struct PyModuleDef _astmodule = {
|
||||
PyModuleDef_HEAD_INIT, "_ast"
|
||||
};
|
||||
|
||||
PyMODINIT_FUNC
|
||||
PyInit__ast(void)
|
||||
{
|
||||
|
@ -8112,5 +8116,3 @@ int PyAST_Check(PyObject* obj)
|
|||
return -1;
|
||||
return PyObject_IsInstance(obj, (PyObject*)&AST_type);
|
||||
}
|
||||
|
||||
|
||||
|
|
3
third_party/python/Python/cosmomodule.c
vendored
3
third_party/python/Python/cosmomodule.c
vendored
|
@ -53,9 +53,12 @@
|
|||
#include "third_party/python/Include/tupleobject.h"
|
||||
#include "third_party/python/Include/warnings.h"
|
||||
#include "third_party/python/Include/weakrefobject.h"
|
||||
#include "third_party/python/Include/yoink.h"
|
||||
#include "third_party/python/Python/importdl.h"
|
||||
/* clang-format off */
|
||||
|
||||
PYTHON_PROVIDE("_cosmo");
|
||||
|
||||
static int cosmo_constants(PyObject *m)
|
||||
{
|
||||
if(PyModule_AddStringMacro(m, MODE)) return -1;
|
||||
|
|
3
third_party/python/Python/import.c
vendored
3
third_party/python/Python/import.c
vendored
|
@ -32,9 +32,12 @@
|
|||
#include "third_party/python/Include/tupleobject.h"
|
||||
#include "third_party/python/Include/warnings.h"
|
||||
#include "third_party/python/Include/weakrefobject.h"
|
||||
#include "third_party/python/Include/yoink.h"
|
||||
#include "third_party/python/Python/importdl.h"
|
||||
/* clang-format off */
|
||||
|
||||
PYTHON_PROVIDE("_imp");
|
||||
|
||||
#define CACHEDIR "__pycache__"
|
||||
|
||||
/* See _PyImport_FixupExtensionObject() below */
|
||||
|
|
3
third_party/python/Python/marshal.c
vendored
3
third_party/python/Python/marshal.c
vendored
|
@ -30,9 +30,12 @@
|
|||
#include "third_party/python/Include/setobject.h"
|
||||
#include "third_party/python/Include/sliceobject.h"
|
||||
#include "third_party/python/Include/tupleobject.h"
|
||||
#include "third_party/python/Include/yoink.h"
|
||||
#include "third_party/python/Modules/hashtable.h"
|
||||
/* clang-format off */
|
||||
|
||||
PYTHON_PROVIDE("marshal");
|
||||
|
||||
/* Write Python objects to files and read them back.
|
||||
This is primarily intended for writing and reading compiled Python code,
|
||||
even though dicts, lists, sets and frozensets, not commonly seen in
|
||||
|
|
3
third_party/python/Python/pylifecycle.c
vendored
3
third_party/python/Python/pylifecycle.c
vendored
|
@ -21,8 +21,8 @@
|
|||
#include "third_party/python/Include/ast.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/code.h"
|
||||
#include "third_party/python/Include/cosmo.h"
|
||||
#include "third_party/python/Include/codecs.h"
|
||||
#include "third_party/python/Include/cosmo.h"
|
||||
#include "third_party/python/Include/dictobject.h"
|
||||
#include "third_party/python/Include/errcode.h"
|
||||
#include "third_party/python/Include/fileobject.h"
|
||||
|
@ -47,6 +47,7 @@
|
|||
#include "third_party/python/Include/traceback.h"
|
||||
#include "third_party/python/Include/unicodeobject.h"
|
||||
#include "third_party/python/Include/warnings.h"
|
||||
#include "third_party/python/Include/yoink.h"
|
||||
/* clang-format off */
|
||||
|
||||
/* Python interpreter top-level routines, including init/exit */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue