summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45866: pegen strips directory of "generated from" header (GH-29777)Victor Stinner2021-11-261-1/+1
| | | | | "make regen-all" now produces the same output when run from a directory other than the source tree: when building Python out of the source tree.
* bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if ↵Pablo Galindo Salgado2021-11-244-4/+7
| | | | inside parentheses (GH-29757)
* Ensure the str member of the tokenizer is always initialised (GH-29681)Pablo Galindo Salgado2021-11-213-3/+3
|
* Refactor parser compilation units into specific components (GH-29676)Pablo Galindo Salgado2021-11-214-1868/+1894
|
* bpo-45811: Improve error message when source code contains invisible control ↵Pablo Galindo Salgado2021-11-201-0/+6
| | | | characters (GH-29654)
* bpo-45450: Improve syntax error for parenthesized arguments (GH-28906)Pablo Galindo Salgado2021-11-201-445/+849
|
* bpo-45494: Fix error location in EOF tokenizer errors (GH-29108)Pablo Galindo Salgado2021-11-201-2/+7
|
* bpo-45848: Allow the parser to get error lines from encoded files (GH-29646)Pablo Galindo Salgado2021-11-201-7/+8
|
* bpo-45727: Make the syntax error for missing comma more consistent (GH-29427)Pablo Galindo Salgado2021-11-192-22/+24
|
* bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are ↵Pablo Galindo Salgado2021-11-161-1/+1
| | | | not provided (GH-29582)
* bpo-45820: Fix a segfault when the parser fails without reading any input ↵Pablo Galindo Salgado2021-11-161-0/+8
| | | | (GH-29580)
* bpo-45738: Fix computation of error location for invalid continuation (GH-29550)Pablo Galindo Salgado2021-11-142-11/+5
| | | characters in the parser
* bpo-45764: improve error message when missing '(' after 'def' (GH-29484)Carl Friedrich Bolz-Tereick2021-11-091-12/+12
| | | | | to achieve this, change the grammar to expect the '(' token after 'def' NAME. Automerge-Triggered-By: GH:pablogsal
* bpo-45716: Improve the error message when using True/False/None as keywords ↵Pablo Galindo Salgado2021-11-051-689/+795
| | | | in a call (GH-29413)
* bpo-44257: fix "assigment_expr" typo + regenerate the grammar, and remove ↵wim glenn2021-11-031-60/+60
| | | | | | unused imports (GH-29393) Co-authored-by: Wim Glenn <wglenn@jumptrading.com>
* bpo-45562: Ensure all tokenizer debug messages are printed to stderr (GH-29270)Pablo Galindo Salgado2021-10-281-1/+1
|
* bpo-45562: Print tokenizer debug messages to stderr (GH-29250)Pablo Galindo Salgado2021-10-271-4/+4
|
* bpo-45574: fix warning about `print_escape` being unused (GH-29172)Nikita Sobolev2021-10-221-0/+2
| | | | | | | | | | | It used to be like this: <img width="1232" alt="Снимок экрана 2021-10-22 в 23 07 40" src="https://user-images.githubusercontent.com/4660275/138516608-fef6ec01-a96a-40f4-81ef-52265b0f536b.png"> Quick `grep` tells that it is just used in one place under `Py_DEBUG`: https://github.com/python/cpython/blame/f6e8b80d20159596cf641305bad3a833bedd2f4f/Parser/tokenizer.c#L1047-L1051 <img width="752" alt="Снимок экрана 2021-10-22 в 23 08 09" src="https://user-images.githubusercontent.com/4660275/138516684-ea503136-1e92-48a5-95bb-419e190d5866.png"> I am not sure, but it also looks like a private thing, it should not affect other users. Automerge-Triggered-By: GH:pablogsal
* bpo-45562: Only show debug output from the parser in debug builds (GH-29140)Pablo Galindo Salgado2021-10-221-0/+2
|
* bpo-45494: Fix parser crash when reporting errors involving invalid ↵Pablo Galindo Salgado2021-10-192-122/+130
| | | | | | | | | | | | continuation characters (GH-28993) There are two errors that this commit fixes: * The parser was not correctly computing the offset and the string source for E_LINECONT errors due to the incorrect usage of strtok(). * The parser was not correctly unwinding the call stack when a tokenizer exception happened in rules involving optionals ('?', [...]) as we always make them return valid results by using the comma operator. We need to check first if we don't have an error before continuing.
* bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" ↵Serhiy Storchaka2021-10-141-1/+1
| | | | | | | | | codec (GH-28939) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.unicode_escape_decode(). It is True by default to match the former behavior.
* bpo-45434: Mark the PyTokenizer C API as private (GH-28924)Victor Stinner2021-10-134-42/+35
| | | | | | | | | | | | | | Rename PyTokenize functions to mark them as private: * PyTokenizer_FindEncodingFilename() => _PyTokenizer_FindEncodingFilename() * PyTokenizer_FromString() => _PyTokenizer_FromString() * PyTokenizer_FromFile() => _PyTokenizer_FromFile() * PyTokenizer_FromUTF8() => _PyTokenizer_FromUTF8() * PyTokenizer_Free() => _PyTokenizer_Free() * PyTokenizer_Get() => _PyTokenizer_Get() Remove the unused PyTokenizer_FindEncoding() function. import.c: remove unused #include "errcode.h".
* bpo-45434: Move _Py_BEGIN_SUPPRESS_IPH to pycore_fileutils.h (GH-28922)Victor Stinner2021-10-131-0/+1
|
* bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)Victor Stinner2021-10-121-0/+1
| | | | | | | * Move _PyObject_CallNoArgs() to pycore_call.h (internal C API). * _ssl, _sqlite and _testcapi extensions now call the public PyObject_CallNoArgs() function, rather than _PyObject_CallNoArgs(). * _lsprof extension is now built with Py_BUILD_CORE_MODULE macro defined to get access to internal _PyObject_CallNoArgs().
* bpo-45439: Rename _PyObject_CallNoArg() to _PyObject_CallNoArgs() (GH-28891)Victor Stinner2021-10-111-1/+1
| | | | | Fix typo in the private _PyObject_CallNoArg() function name: rename it to _PyObject_CallNoArgs() to be consistent with the public function PyObject_CallNoArgs().
* bpo-45408: Don't override previous tokenizer errors in the second parser ↵Pablo Galindo Salgado2021-10-071-1/+4
| | | | pass (GH-28812)
* Fix typos in the Objects directory (GH-28766)Christian Clauss2021-10-061-1/+1
|
* Optimized code format (GH-28599)Rajendra arora2021-09-281-3/+1
| | | Automerge-Triggered-By: GH:pablogsal
* Fixed typo in "decclarations" (GH-28578)Rajendra arora2021-09-281-1/+1
|
* bpo-43914: Correctly highlight SyntaxError exceptions for invalid generator ↵Pablo Galindo Salgado2021-09-273-6/+18
| | | | expression in function calls (GH-28576)
* Extract visitors from the grammar nodes and call makers in the peg generator ↵Pablo Galindo Salgado2021-09-051-167/+167
| | | | | (GH-28172) Simplify the peg generator logic by extracting as much visitors as possible to disentangle the flow and separate concerns.
* bpo-44947: Refine the syntax error for trailing commas in import statements ↵Pablo Galindo Salgado2021-08-181-5/+8
| | | | (GH-27814)
* Update pegen to use the latest upstream developments (GH-27586)Pablo Galindo Salgado2021-08-123-41/+55
|
* bpo-44885: Correct the ast locations of f-strings with format specs and ↵Pablo Galindo Salgado2021-08-121-38/+30
| | | | repeated expressions (GH-27729)
* bpo-44854: Remove trailing whitespaces (GH-27689)Serhiy Storchaka2021-08-091-1/+1
|
* bpo-44838: Refine the custom syntax errors for invalid 'if' expressions ↵Pablo Galindo Salgado2021-08-051-553/+610
| | | | (GH-27615)
* bpo-44792: Improve syntax errors for if expressions (GH-27506)Miguel Brito2021-08-021-0/+33
|
* bpo-34013: Don't consider a grouped expression when reporting legacy print ↵Pablo Galindo Salgado2021-08-011-5/+7
| | | | syntax errors (GH-27521)
* Divide the grammar into sections to improve readability (GH-27502)Pablo Galindo Salgado2021-07-311-6585/+6583
|
* Update URLs in comments and metadata to use HTTPS (GH-27458)Noah Kantrowitz2021-07-301-1/+1
|
* bpo-34013: Move the Python 2 hints from the exception constructor to the ↵Pablo Galindo Salgado2021-07-271-7/+7
| | | | parser (GH-27392)
* bpo-34013: Generalize the invalid legacy statement error message (GH-27389)Pablo Galindo Salgado2021-07-273-243/+322
|
* bpo-43950: Distinguish errors happening on character offset decoding (GH-27217)Batuhan Taskaya2021-07-201-5/+13
|
* Remove unnecessary 'invalid_primary' rule in the parser (GH-27186)Pablo Galindo Salgado2021-07-161-304/+237
|
* bpo-44317: Improve tokenizer errors with more informative locations (GH-26555)Pablo Galindo Salgado2021-07-101-18/+54
|
* bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)Ammar Askar2021-07-042-23/+24
| | | | | | | | The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location to print carets on the specific expressions involved in a traceback. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-40528: fix is_simple(sum)s behavior for attributes (GH-26918)Batuhan Taskaya2021-06-271-6/+10
| | | | | | | | This is something I noticed while (now discontinued) experimenting with the idea of annotating operators with location information. Unfortunately without this addition, adding any `attributes` to stuff like `unaryop` doesn't change anything since the code assumes they are singletons and caches all instances. This patch fixes this assumption with including the attributes as well as constructor fields.
* bpo-44456: Improve the syntax error when mixing keyword and positional ↵Pablo Galindo2021-06-243-464/+638
| | | | patterns (GH-26793)
* bpo-40528: move asdl identifier collection to the new metadata system (GH-26858)Batuhan Taskaya2021-06-241-49/+51
|
* bpo-40528: Implement a metadata system for ASDL Generator (GH-20193)Batuhan Taskaya2021-06-221-24/+75
| | | | | | | | ASDL Generator was lack of proper annotation related to generated module. This patch implements a MetadataVisitor that produces a metadata object to pass to other visitors that are visiting that same module. For the inital patch, it dynamically retrieves int sequences (like cmpop), that was previously hardcoded. It offers an interface that is easy to extend.