summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-34100: compile: Re-enable frozenset merging (GH-10760)INADA Naoki2018-11-281-2/+57
| | | This reverts commit 1005c84535191a72ebb7587d8c5636a065b7ed79.
* bpo-34100: Partially revert merge_consts_recursive() (GH-10743)Victor Stinner2018-11-271-50/+0
| | | | | Partically revert commit c2e1607a51d7a17f143b5a34e8cff7c6fc58a091 to fix a reference leak.
* bpo-34100: Merge constants recursively (GH-8341)INADA Naoki2018-11-261-8/+161
| | | | | | | There are some same consts in a module. This commit merges them into single instance. It reduces number of objects in memory after loading modules. https://bugs.python.org/issue34100
* bpo-35177: Add dependencies between header files (GH-10361)Victor Stinner2018-11-111-1/+0
| | | | | | | | | | | | | | * ast.h now includes Python-ast.h and node.h * parsetok.h now includes node.h and grammar.h * symtable.h now includes Python-ast.h * Modify asdl_c.py to enhance Python-ast.h: * Add #ifndef/#define Py_PYTHON_AST_H to be able to include the header twice * Add "extern { ... }" for C++ * Undefine "Yield" macro conflicting with winbase.h * Remove "#undef Yield" from C files, it's now done in Python-ast.h * Remove now useless includes in C files
* bpo-34876: Change the lineno of the AST for decorated function and class. ↵Serhiy Storchaka2018-10-301-3/+14
| | | | | | | (GH-9731) It was overridden by the lineno of the first decorator. Now it is the lineno of 'def' or 'class'.
* bpo-35029: Replace the SyntaxWarning exception with a SyntaxError. (GH-9999)Serhiy Storchaka2018-10-211-11/+31
| | | | If SyntaxWarning was raised as an exception, it will be replaced with a SyntaxError for better error reporting.
* Fix an incorrect check in compiler_try_except(). (GH-9810)Zackery Spytz2018-10-121-1/+2
|
* bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445)Serhiy Storchaka2018-09-271-58/+6
|
* bpo-34683: Make SyntaxError column offsets consistently 1-indexed (gh-9338)Ammar Askar2018-09-241-1/+1
| | | | | | Also point to start of tokens in parsing errors. Fixes bpo-34683
* bpo-32455: Add jump parameter to dis.stack_effect(). (GH-6610)Serhiy Storchaka2018-09-181-0/+6
| | | | Add C API function PyCompile_OpcodeStackEffectWithJump().
* bpo-12458: Fix line numbers for multiline expressions. (GH-8774)Serhiy Storchaka2018-09-171-14/+26
|
* closes bpo-34646: Remove PyAPI_* macros from declarations. (GH-9218)Benjamin Peterson2018-09-121-1/+1
|
* bpo-33691: Add _PyAST_GetDocString(). (GH-7236)Serhiy Storchaka2018-05-301-30/+15
|
* bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)Serhiy Storchaka2018-05-291-13/+42
| | | | | | Remove the docstring attribute of AST types and restore docstring expression as a first stmt in their body. Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-33475: Fix and improve converting annotations to strings. (GH-6774)Serhiy Storchaka2018-05-171-1/+1
|
* bpo-33363: raise SyntaxError for async for/with outside async functions (#6616)Zsolt Dollenstein2018-04-271-0/+7
|
* bpo-33334: Support NOP and EXTENDED_ARG in dis.stack_effect(). (#6566)Serhiy Storchaka2018-04-251-0/+4
| | | Added tests to ensure that all defined opcodes are supported.
* bpo-33298: Wrap only constants with _PyCode_ConstantKey() in the compiler. ↵Serhiy Storchaka2018-04-201-104/+117
| | | | (GH-6512)
* bpo-33299: Return an object itself for some types in _PyCode_ConstantKey(). ↵Serhiy Storchaka2018-04-191-4/+6
| | | | (GH-6513)
* bpo-33270: Intern names for all anonymous code objects (#6472)Zackery Spytz2018-04-151-4/+4
|
* bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)Serhiy Storchaka2018-03-311-4/+2
|
* bpo-33132: Fix reference counting issues in the compiler. (GH-6209)Serhiy Storchaka2018-03-241-19/+12
|
* bpo-33041: Rework compiling an "async for" loop. (#6142)Serhiy Storchaka2018-03-231-96/+22
| | | | | | | | * Added new opcode END_ASYNC_FOR. * Setting global StopAsyncIteration no longer breaks "async for" loops. * Jumping into an "async for" loop is now disabled. * Jumping out of an "async for" loop no longer corrupts the stack. * Simplify the compiler.
* bpo-32489: Allow 'continue' in 'finally' clause. (GH-5822)Serhiy Storchaka2018-03-181-4/+0
|
* bpo-33041: Add missed error checks when compile "async for" (#6053)Serhiy Storchaka2018-03-101-14/+7
| | | and remove redundant code.
* bpo-33041: Fixed bytecode generation for "async for" with a complex target. ↵Serhiy Storchaka2018-03-101-2/+2
| | | | | | (#6052) A StopAsyncIteration raised on assigning or unpacking will be now propagated instead of stopping the iteration.
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-165/+244
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)Mark Shannon2018-01-301-6/+10
|
* String annotations [PEP 563] (#4390)Guido van Rossum2018-01-261-2/+24
| | | | | | | | * Document `from __future__ import annotations` * Provide plumbing and tests for `from __future__ import annotations` * Implement unparsing the AST back to string form This is required for PEP 563 and as such only implements a part of the unparsing process that covers expressions.
* bpo-31113: Get rid of recursion in the compiler for normal control flow. (#3015)Serhiy Storchaka2018-01-111-78/+104
|
* bpo-24340: Fix estimation of the code stack size. (#5076)Serhiy Storchaka2018-01-091-37/+90
|
* bpo-32439: Clean up the code for compiling comparison expressions. (#5029)Serhiy Storchaka2017-12-301-23/+20
|
* bpo-32372: Move __debug__ optimization to the AST level. (#4925)Serhiy Storchaka2017-12-251-18/+8
|
* bpo-32365: Fix a reference leak when compile __debug__. (#4916)Serhiy Storchaka2017-12-181-4/+4
| | | It was introduced in bpo-27169.
* bpo-27169: The __debug__ constant is now optimized out at compile time. (#4880)Serhiy Storchaka2017-12-151-30/+15
| | | This fixes also bpo-22091.
* bpo-29469: Move constant folding to AST optimizer (GH-2858)INADA Naoki2017-12-141-0/+4
|
* bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)Nick Coghlan2017-12-031-5/+0
| | | | | | | | Previously, CO_NOFREE was set in the compiler, which meant it could end up being set incorrectly when code objects were created directly. Setting it in the constructor based on freevars and cellvars ensures it is always accurate, regardless of how the code object is defined.
* Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka2017-11-111-1/+1
| | | | (#4370)
* bpo-31708: Allow async generator expressions in synchronous functions (#3905)Yury Selivanov2017-10-061-1/+1
|
* bpo-31709: Drop support for asynchronous __aiter__. (#3903)Yury Selivanov2017-10-061-6/+0
|
* bpo-31338 (#3374)Barry Warsaw2017-09-151-2/+1
| | | | | | | * Add Py_UNREACHABLE() as an alias to abort(). * Use Py_UNREACHABLE() instead of assert(0) * Convert more unreachable code to use Py_UNREACHABLE() * Document Py_UNREACHABLE() and a few other macros.
* bpo-31286, bpo-30024: Fixed stack usage in absolute imports with (#3217)Serhiy Storchaka2017-08-291-10/+16
| | | binding a submodule to a name.
* bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. ↵Stefan Krah2017-08-211-2/+3
| | | | (#3157)
* bpo-30501: Make the compiler producing optimized code for condition ↵Serhiy Storchaka2017-06-111-41/+137
| | | | expressions. (#1851)
* bpo-30024: Circular imports involving absolute imports with binding (#1264)Serhiy Storchaka2017-05-091-2/+2
| | | a submodule to a name are now supported.
* bpo-29878: Add global instances of int for 0 and 1. (#852)Serhiy Storchaka2017-03-301-16/+3
|
* bpo-29463: Add docstring field to some AST nodes. (#46)INADA Naoki2017-02-221-48/+16
| | | | | | | | | | | * bpo-29463: Add docstring field to some AST nodes. ClassDef, ModuleDef, FunctionDef, and AsyncFunctionDef has docstring field for now. It was first statement of there body. * fix document. thanks travis! * doc fixes
* bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX (#202)Matthieu Dartiailh2017-02-211-1/+1
|
* Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-161-17/+9
| | | | dict.
* Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov2016-12-141-0/+37
| | | | | | | Special thanks to INADA Naoki for pushing the patch through the last mile, Serhiy Storchaka for reviewing the code, and to Victor Stinner for suggesting the idea (originally implemented in the PyPy project).