summaryrefslogtreecommitdiff
path: root/Parser
AgeCommit message (Collapse)AuthorLines
2019-12-09bpo-38673: dont switch to ps2 if the line starts with comment or whitespace ↵Miss Islington (bot)-0/+6
(GH-17421) (GH-17522) https://bugs.python.org/issue38673 (cherry picked from commit 109fc2792a490ee5cd8a423e17d415fbdedec5c8) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2019-10-10bpo-38425: Fix ‘res’ may be used uninitialized warning (GH-16688)Miss Islington (bot)-1/+2
(cherry picked from commit a05fcd3c7adf6e3a0944da8cf80a3346882e9b3b) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-08-15Indent code inside if block. (GH-15284)Miss Islington (bot)-1/+1
Without indendation, seems like strcpy line is parallel to `if` condition. (cherry picked from commit 69f37bcb28d7cd78255828029f895958b5baf6ff) Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
2019-03-28bpo-36459: Fix a possible double PyMem_FREE() due to tokenizer.c's ↵Miss Islington (bot)-1/+0
tok_nextc() (12601) Remove the PyMem_FREE() call added in cb90c89. The buffer will be freed when PyTokenizer_Free() is called on the tokenizer state. (cherry picked from commit cda139d1ded6708665b53e4ed32ccc1d2627e1da) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-03-20bpo-36367: Free buffer if realloc fails in tokenize.c (GH-12442) (GH-12471)Victor Stinner-2/+8
2018-12-07bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz-6/+42
(GH-11015) (GH-11020) (cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
2018-08-20bpo-34400: Fix more undefined behavior in parsetok.c (GH-8833)Miss Islington (bot)-2/+4
(cherry picked from commit 3e26e42c905852394fa136f1cc564dac98b56166) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-08-15closes bpo-34400: Fix undefined behavior in parsetok(). (GH-4439)Miss Islington (bot)-1/+1
Avoid undefined pointer arithmetic with NULL. (cherry picked from commit 7c4ab2afb17b99eb3f61f9c73cbd548b5e0ad2c0) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-29bpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. ↵Miss Islington (bot)-1/+4
(GH-7911) (cherry picked from commit ce75df3031c86b78311b1ad76c39c0b39d7d7424) Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
2018-07-24bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. ↵Miss Islington (bot)-2/+1
(GH-8262) (GH-8423) (cherry picked from commit aba24ff3601ddc86b85e01880a8be596fb799287) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-28bpo-31546: Fix input hook integration (GH-7978)Miss Islington (bot)-0/+3
(cherry picked from commit 9b9d58f0d88b338eb8d2ae0da5cd91d60d1b0e39) Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
2018-05-30bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196)Miss Islington (bot)-1/+2
(cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-29bpo-32911: Revert bpo-29463. (GH-7121)Serhiy Storchaka-7/+4
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>
2018-01-25 bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka-55/+26
(GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
2017-12-31closes bpo-32460: ensure all non-static globals have initializers (#5061)Benjamin Peterson-2/+2
2017-11-28bpo-32150: Expand tabs to spaces in C files. (#4583)Serhiy Storchaka-10/+10
2017-11-24bpo-32096: Remove obj and mem from _PyRuntime (#4532)Victor Stinner-2/+0
bpo-32096, bpo-30860: Partially revert the commit 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6: * Move structures back from Include/internal/mem.h to Objects/obmalloc.c * Remove _PyObject_Initialize() and _PyMem_Initialize() * Remove Include/internal/pymalloc.h * Add test_capi.test_pre_initialization_api(): Make sure that it's possible to call Py_DecodeLocale(), and then call Py_SetProgramName() with the decoded string, before Py_Initialize(). PyMem_RawMalloc() and Py_DecodeLocale() can be called again before _PyRuntimeState_Init(). Co-Authored-By: Eric Snow <ericsnowcurrently@gmail.com>
2017-11-17tokenizer: Remove unused tabs options (#4422)Victor Stinner-34/+11
Remove the following fields from tok_state structure which are now used unused: * altwarning: "Issue warning if alternate tabs don't match" * alterror: "Issue error if alternate tabs don't match" * alttabsize: "Alternate tab spacing" Replace alttabsize variable with ALTTABSIZE define.
2017-11-15bpo-32030: Split Py_Main() into subfunctions (#4399)Victor Stinner-3/+1
* Don't use "Python runtime" anymore to parse command line options or to get environment variables: pymain_init() is now a strict separation. * Use an error message rather than "crashing" directly with Py_FatalError(). Limit the number of calls to Py_FatalError(). It prepares the code to handle errors more nicely later. * Warnings options (-W, PYTHONWARNINGS) and "XOptions" (-X) are now only added to the sys module once Python core is properly initialized. * _PyMain is now the well identified owner of some important strings like: warnings options, XOptions, and the "program name". The program name string is now properly freed at exit. pymain_free() is now responsible to free the "command" string. * Rename most methods in Modules/main.c to use a "pymain_" prefix to avoid conflits and ease debug. * Replace _Py_CommandLineDetails_INIT with memset(0) * Reorder a lot of code to fix the initialization ordering. For example, initializing standard streams now comes before parsing PYTHONWARNINGS. * Py_Main() now handles errors when adding warnings options and XOptions. * Add _PyMem_GetDefaultRawAllocator() private function. * Cleanup _PyMem_Initialize(): remove useless global constants: move them into _PyMem_Initialize(). * Call _PyRuntime_Initialize() as soon as possible: _PyRuntime_Initialize() now returns an error message on failure. * Add _PyInitError structure and following macros: * _Py_INIT_OK() * _Py_INIT_ERR(msg) * _Py_INIT_USER_ERR(msg): "user" error, don't abort() in that case * _Py_INIT_FAILED(err)
2017-11-11bpo-31572: Get rid of _PyObject_HasAttrId() in the ASDL parser. (#3725)Serhiy Storchaka-18/+28
Silence only expected AttributeError.
2017-10-05bpo-30406: Make async and await proper keywords (#1669)Jelle Zijlstra-70/+0
Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
2017-09-20bpo-31536: Avoid wholesale rebuild after `make regen-all` (#3678)Antoine Pitrou-41/+37
* bpo-31536: Avoid wholesale rebuild after `make regen-all` * Add NEWS
2017-09-14bpo-31464: asdl_c.py no longer emits trailing spaces in Python-ast.h. (#3568)Serhiy Storchaka-2/+3
2017-09-14bpo-31338 (#3374)Barry Warsaw-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.
2017-09-07bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow-0/+6
* group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
2017-09-07bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou-22/+0
* Remove Setup.config * Always define WITH_THREAD for compatibility.
2017-09-05Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow-4/+0
Windows buildbots started failing due to include-related errors.
2017-09-05bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow-0/+4
* group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
2017-08-24bpo-31095: fix potential crash during GC (GH-2974)INADA Naoki-0/+2
2017-08-04Fix a shadow-compatible-local warning (#2180)Yuan Chao Chou-3/+3
Change the shadowing naming, 'value' (Python-ast.c:4652), to 'val' to prevent the variables from being misused.
2017-06-01bpo-25324: add missing comma in Parser/tokenizer.c (GH-1910)Albert-Jan Nijburg-1/+1
2017-05-31bpo-25324: copy tok_name before changing it (#1608)Albert-Jan Nijburg-0/+3
* add test to check if were modifying token * copy list so import tokenize doesnt have side effects on token * shorten line * add tokenize tokens to token.h to get them to show up in token * move ERRORTOKEN back to its previous location, and fix nitpick * copy comments from token.h automatically * fix whitespace and make more pythonic * change to fix comments from @haypo * update token.rst and Misc/NEWS * change wording * some more wording changes
2017-04-03Remove obsolete declaration in tokenizer.h (#962)Jim Fasarakis-Hilliard-2/+0
2017-03-23Use NULL rather than 0. (#778)Serhiy Storchaka-1/+1
There was few cases of using literal 0 instead of NULL in the context of pointers. While this was a legitimate C code, using NULL rather than 0 makes the code clearer.
2017-02-24bpo-29622: Make AST constructor to accept less than enough number of ↵INADA Naoki-19/+17
positional arguments (GH-249) bpo-29463 added optional "docstring" field to 4 AST types. While it is optional, it breaks backward compatibility because AST constructor requires number of positional argument is same to number of fields. AST types accepts empty arguments, and incomplete keyword arguments. But it's not big problem because field can be filled after creation, and checked when compiling. So stop requiring complete set of fields for positional arguments too.
2017-02-22bpo-29463: Add docstring field to some AST nodes. (#46)INADA Naoki-4/+7
* 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
2017-02-05Issue #28489: Merge from 3.6Berker Peksag-1/+1
2017-02-05Issue #28489: Fix comment in tokenizer.cBerker Peksag-1/+1
Patch by Ryan Gonzalez.
2017-01-25Issue #29369: Use Py_IDENTIFIER in Python-ast.cINADA Naoki-8/+13
2016-12-06Use _PyObject_CallNoArg()Victor Stinner-3/+3
Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
2016-11-20Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka-1/+1
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
2016-10-25Issue #28333: Fixes off-by-one error that was adding an extra space.Steve Dower-1/+2
2016-10-08Issue #28333: Remove unnecessary increment.Steve Dower-1/+1
2016-10-08Issue #28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by ↵Steve Dower-4/+24
Eryk Sun)
2016-10-07Issue #24098: Fixed possible crash when AST is changed in process ofSerhiy Storchaka-0/+7
compiling it.
2016-10-07Issue #24098: Fixed possible crash when AST is changed in process ofSerhiy Storchaka-0/+7
compiling it.
2016-09-19merge 3.5 (#28184)Benjamin Peterson-3/+3
2016-09-18merge 3.5 (#24022)Benjamin Peterson-1/+1
2016-09-18merge 3.4Benjamin Peterson-1/+1
2016-09-18properly handle the single null-byte file (closes #24022)Benjamin Peterson-1/+1