summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-251-55/+26
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* closes bpo-32460: ensure all non-static globals have initializers (#5061)Benjamin Peterson2017-12-311-2/+2
|
* bpo-32150: Expand tabs to spaces in C files. (#4583)Serhiy Storchaka2017-11-281-10/+10
|
* bpo-32096: Remove obj and mem from _PyRuntime (#4532)Victor Stinner2017-11-241-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>
* tokenizer: Remove unused tabs options (#4422)Victor Stinner2017-11-172-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.
* bpo-32030: Split Py_Main() into subfunctions (#4399)Victor Stinner2017-11-151-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)
* bpo-31572: Get rid of _PyObject_HasAttrId() in the ASDL parser. (#3725)Serhiy Storchaka2017-11-111-18/+28
| | | Silence only expected AttributeError.
* bpo-30406: Make async and await proper keywords (#1669)Jelle Zijlstra2017-10-062-70/+0
| | | Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
* bpo-31536: Avoid wholesale rebuild after `make regen-all` (#3678)Antoine Pitrou2017-09-201-42/+38
| | | | | | * bpo-31536: Avoid wholesale rebuild after `make regen-all` * Add NEWS
* bpo-31464: asdl_c.py no longer emits trailing spaces in Python-ast.h. (#3568)Serhiy Storchaka2017-09-151-2/+3
|
* 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-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-082-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).
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-072-22/+0
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow2017-09-061-4/+0
| | | Windows buildbots started failing due to include-related errors.
* bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow2017-09-061-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).
* bpo-31095: fix potential crash during GC (GH-2974)INADA Naoki2017-08-241-0/+2
|
* Fix a shadow-compatible-local warning (#2180)Yuan Chao Chou2017-08-041-3/+3
| | | | Change the shadowing naming, 'value' (Python-ast.c:4652), to 'val' to prevent the variables from being misused.
* bpo-25324: add missing comma in Parser/tokenizer.c (GH-1910)Albert-Jan Nijburg2017-06-011-1/+1
|
* bpo-25324: copy tok_name before changing it (#1608)Albert-Jan Nijburg2017-05-311-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
* Remove obsolete declaration in tokenizer.h (#962)Jim Fasarakis-Hilliard2017-04-031-2/+0
|
* Use NULL rather than 0. (#778)Serhiy Storchaka2017-03-231-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.
* bpo-29622: Make AST constructor to accept less than enough number of ↵INADA Naoki2017-02-231-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.
* bpo-29463: Add docstring field to some AST nodes. (#46)INADA Naoki2017-02-221-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
* Issue #28489: Merge from 3.6Berker Peksag2017-02-051-1/+1
|\
| * Issue #28489: Fix comment in tokenizer.cBerker Peksag2017-02-051-1/+1
| | | | | | | | Patch by Ryan Gonzalez.
* | Issue #29369: Use Py_IDENTIFIER in Python-ast.cINADA Naoki2017-01-251-8/+13
| |
* | Use _PyObject_CallNoArg()Victor Stinner2016-12-061-3/+3
|/ | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-1/+1
| | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* Issue #28333: Fixes off-by-one error that was adding an extra space.Steve Dower2016-10-251-1/+2
|
* Issue #28333: Remove unnecessary increment.Steve Dower2016-10-081-1/+1
|
* Issue #28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by ↵Steve Dower2016-10-081-4/+24
| | | | Eryk Sun)
* Issue #24098: Fixed possible crash when AST is changed in process ofSerhiy Storchaka2016-10-071-0/+7
|\ | | | | | | compiling it.
| * Issue #24098: Fixed possible crash when AST is changed in process ofSerhiy Storchaka2016-10-071-0/+7
| | | | | | | | compiling it.
* | merge 3.5 (#28184)Benjamin Peterson2016-09-201-3/+3
|\ \ | |/
* | merge 3.5 (#24022)Benjamin Peterson2016-09-191-1/+1
|\ \ | |/
| * merge 3.4Benjamin Peterson2016-09-191-1/+1
| |\
| | * properly handle the single null-byte file (closes #24022)Benjamin Peterson2016-09-191-1/+1
| | |
* | | properly free memory in pgenBenjamin Peterson2016-09-193-2/+34
| | |
* | | merge 3.5 (#27981)Benjamin Peterson2016-09-131-15/+17
|\ \ \ | |/ /
| * | restructure fp_setreadl so as to avoid refleaks (closes #27981)Benjamin Peterson2016-09-131-15/+17
| | |
* | | Issue #26331: Implement the parsing part of PEP 515.Brett Cannon2016-09-091-68/+162
| | | | | | | | | | | | Thanks to Georg Brandl for the patch.
* | | Issue #28008: Implement PEP 530 -- asynchronous comprehensions.Yury Selivanov2016-09-091-1/+1
| | |
* | | Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov2016-09-091-0/+2
| | | | | | | | | | | | Patch by Ivan Levkivskyi.
* | | Skip unused value in tokenizer codeChristian Heimes2016-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | In the case of an escape character, c is never read. tok_next() is used to advance the pointer. CID 1225097
* | | Issue #1602: Windows console doesn't input or print Unicode (PEP 528)Steve Dower2016-08-311-0/+113
| | | | | | | | | | | | Closes #17602: Adds a readline implementation for the Windows console
* | | Issue #23524: Finish removing _PyVerify_fd from sourcesSteve Dower2016-09-081-4/+1
| | |
* | | replace PY_SIZE_MAX with SIZE_MAXBenjamin Peterson2016-09-071-1/+1
| | |
* | | replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-062-3/+3
| | |
* | | Fix a clang warning in grammar.cVictor Stinner2016-08-191-0/+6
| | | | | | | | | | | | | | | Clang is smarter than GCC and emits a warning for dead code after a function declared with __attribute__((__noreturn__)) (Py_FatalError).
* | | Issue #27336: Fix compilation failures --without-threadsBerker Peksag2016-06-171-2/+3
| | |