summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* bpo-44409: Fix error location in tokenizer errors that happen during ↵Pablo Galindo2021-06-141-0/+1
| | | | initialization (GH-26712)
* Fix typos in multiple files (GH-26689)Binbin2021-06-131-3/+3
| | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-44396: Update multi-line-start location when reallocating tokenizer ↵Pablo Galindo2021-06-121-0/+5
| | | | | buffers (GH-26676) Automerge-Triggered-By: GH:pablogsal
* Add more const modifiers. (GH-26691)Serhiy Storchaka2021-06-123-15/+15
|
* bpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632)Pablo Galindo2021-06-101-213/+313
|
* bpo-44385: Remove unused grammar rules (GH-26655)Lysandros Nikolaou2021-06-101-1256/+791
| | | Automerge-Triggered-By: GH:lysnikolaou
* bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft ↵Pablo Galindo2021-06-091-4/+11
| | | | keywords (GH-26630)
* bpo-44345: Fix 'generated by' comment in parser.c (GH-26615)Akira Nonaka2021-06-091-1/+1
|
* bpo-44349: Fix edge case when displaying text from files with encoding in ↵Pablo Galindo2021-06-081-2/+5
| | | | syntax errors (GH-26611)
* bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466)Serhiy Storchaka2021-06-081-0/+128
| | | | | | | | Emit a deprecation warning if the numeric literal is immediately followed by one of keywords: and, else, for, if, in, is, or. Raise a syntax error with more informative message if it is immediately followed by other keyword or identifier. Automerge-Triggered-By: GH:pablogsal
* bpo-44335: Ensure the tokenizer doesn't go into Python with the error set ↵Pablo Galindo2021-06-081-3/+17
| | | | (GH-26608)
* bpo-44335: Fix a regression when identifying invalid characters in syntax ↵Pablo Galindo2021-06-081-1/+3
| | | | errors (GH-26589)
* fix: use unambiguous punction in 'invalid escape sequence' message (GH-26582)Ned Batchelder2021-06-081-2/+2
|
* bpo-44305: Improve syntax error for try blocks without except or finally ↵Pablo Galindo2021-06-031-269/+358
| | | | (GH-26523)
* bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)Batuhan Taskaya2021-06-031-4/+15
| | | | | | | When compiling an AST object with a direct / indirect reference cycles, on the conversion phase because of exceeding amount of calls, a segfault was raised. This patch adds recursion guards to places for preventing user inputs to not to crash AST but instead raise a RecursionError.
* bpo-44273: Improve syntax error message for assigning to "..." (GH-26477)Serhiy Storchaka2021-06-011-1/+1
| | | Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
* bpo-44201: Avoid side effects of "invalid_*" rules in the REPL (GH-26298)Pablo Galindo2021-05-223-0/+22
| | | | | | | | | | | | When the parser does a second pass to check for errors, these rules can have some small side-effects as they may advance the parser more than the point reached in the first pass. This can cause the tokenizer to ask for extra tokens in interactive mode causing the tokenizer to show the prompt instead of failing instantly. To avoid this, add a new mode to the tokenizer that is activated in the second pass and deactivates asking for new tokens when the interactive line is finished. As the parsing should have reached the last line in the first pass, the second pass should not need to ask for more tokens.
* bpo-44180: Fix edge cases in invalid assigment rules in the parser (GH-26283)Pablo Galindo2021-05-213-1172/+1403
| | | | | | | | | | | | | | | The invalid assignment rules are very delicate since the parser can easily raise an invalid assignment when a keyword argument is provided. As they are very deep into the grammar tree, is very difficult to specify in which contexts these rules can be used and in which don't. For that, we need to use a different version of the rule that doesn't do error checking in those situations where we don't want the rule to raise (keyword arguments and generator expressions). We also need to check if we are in left-recursive rule, as those can try to eagerly advance the parser even if the parse will fail at the end of the expression. Failing to do this allows the parser to start parsing a call as a tuple and incorrectly identify a keyword argument as an invalid assignment, before it realizes that it was not a tuple after all.
* bpo-44180: Report generic syntax errors in the furthest position reached in ↵Pablo Galindo2021-05-211-1/+6
| | | | the first parser pass (GH-26253)
* bpo-44168: Fix error message in the parser for keyword arguments for invalid ↵Pablo Galindo2021-05-191-541/+584
| | | | expressions (GH-26210)
* bpo-44143: Fix crash in the parser when raising tokenizer errors with an ↵Pablo Galindo2021-05-151-0/+1
| | | | exception set (GH-26144)
* bpo-43149: Correct the syntax error message for multiple exception types ↵Pablo Galindo2021-05-081-1/+1
| | | | | (GH-25996) Automerge-Triggered-By: GH:pablogsal
* bpo-43822: Prioritize tokenizer errors over custom syntax errors when ↵Pablo Galindo2021-05-041-0/+3
| | | | raising parser exceptions (GH-25866)
* bpo-43892: Validate the first term of complex literal value patterns (GH-25735)Brandt Bucher2021-04-303-397/+526
|