mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merge ast-branch to head
This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
This commit is contained in:
parent
2cb94aba12
commit
3e0055f8c6
54 changed files with 13675 additions and 6810 deletions
|
@ -1,6 +1,8 @@
|
|||
#include "Python.h"
|
||||
|
||||
#include "code.h"
|
||||
#include "compile.h"
|
||||
#include "Python-ast.h"
|
||||
#include "symtable.h"
|
||||
|
||||
static PyObject *
|
||||
|
@ -64,9 +66,9 @@ init_symtable(void)
|
|||
PyModule_AddIntConstant(m, "DEF_IMPORT", DEF_IMPORT);
|
||||
PyModule_AddIntConstant(m, "DEF_BOUND", DEF_BOUND);
|
||||
|
||||
PyModule_AddIntConstant(m, "TYPE_FUNCTION", TYPE_FUNCTION);
|
||||
PyModule_AddIntConstant(m, "TYPE_CLASS", TYPE_CLASS);
|
||||
PyModule_AddIntConstant(m, "TYPE_MODULE", TYPE_MODULE);
|
||||
PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock);
|
||||
PyModule_AddIntConstant(m, "TYPE_CLASS", ClassBlock);
|
||||
PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock);
|
||||
|
||||
PyModule_AddIntConstant(m, "OPT_IMPORT_STAR", OPT_IMPORT_STAR);
|
||||
PyModule_AddIntConstant(m, "OPT_EXEC", OPT_EXEC);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue