mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
gh-108113: Make it possible to create an optimized AST (#108154)
This commit is contained in:
parent
47022a079e
commit
10a91d7e98
10 changed files with 124 additions and 14 deletions
|
@ -1208,6 +1208,9 @@ class ASTModuleVisitor(PickleVisitor):
|
|||
self.emit('if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0) {', 1)
|
||||
self.emit("return -1;", 2)
|
||||
self.emit('}', 1)
|
||||
self.emit('if (PyModule_AddIntMacro(m, PyCF_OPTIMIZED_AST) < 0) {', 1)
|
||||
self.emit("return -1;", 2)
|
||||
self.emit('}', 1)
|
||||
for dfn in mod.dfns:
|
||||
self.visit(dfn)
|
||||
self.emit("return 0;", 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue