summaryrefslogtreecommitdiffstats
path: root/Grammar
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-119724: Revert "bpo-45759: Better error messages for non-matching ↵T. Wouters2024-06-041-5/+0
| | | | | | | | 'elif'/'else' statements (GH-29513)" (GH-119974) (GH-120013) This reverts commit 1c8f912ebdfdb146cd7dd2d7a3a67d2c5045ddb0. (cherry picked from commit 31a4fb3c74a0284436343858803b54471e2dc9c7)
* gh-118090: Improve error message for empty type param brackets (GH-118091)Nikita Sobolev2024-05-071-3/+12
|
* gh-116126: Implement PEP 696 (#116129)Jelle Zijlstra2024-05-031-3/+7
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-118323: Document `&&` grammar syntax (#118324)Nikita Sobolev2024-04-271-0/+3
|
* gh-116988: Remove duplicates of `annotated_rhs` in the Grammar (#117004)David Rubin2024-04-241-9/+9
|
* gh-118082: Improve `import` without names syntax error message (#118083)Nikita Sobolev2024-04-231-0/+4
|
* gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444)Grigoriev Semyon2024-04-021-2/+4
|
* bpo-24612: Improve syntax error for 'not' after an operator (GH-28170)Pablo Galindo Salgado2024-03-261-0/+7
| | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* gh-115881: Ensure `ast.parse()` parses conditional context managers even ↵Alex Waygood2024-02-261-1/+1
| | | | with low `feature_version` passed (#115920)
* gh-111488: Changed error message in case of no 'in' keyword after 'for' in ↵Grigoriev Semyon2024-01-061-0/+2
| | | | cmp (#113656)
* bpo-45759: Better error messages for non-matching 'elif'/'else' statements ↵Crowthebird2023-11-201-0/+5
| | | | (#29513)
* gh-111420: Allow type comments in parenthesized `with` statements (#111468)Tomas R2023-10-311-2/+2
|
* gh-110938: Fix error messages for indented blocks with functions and classes ↵Pablo Galindo Salgado2023-10-171-3/+3
| | | | with generic type parameters (#110973)
* gh-110696: Fix incorrect syntax error message for incorrect argument ↵Pablo Galindo Salgado2023-10-121-1/+2
| | | | unpacking (#110706)
* gh-109596: Ensure repeated rules in the grammar are not allowed and fix ↵Pablo Galindo Salgado2023-09-221-7/+4
| | | | incorrect soft keywords (#109606)
* gh-109114: Relax the check for invalid lambdas inside f-strings to avoid ↵Pablo Galindo Salgado2023-09-081-1/+1
| | | | false positives (#109121)
* gh-107015: Remove async_hacks from the tokenizer (#107018)Pablo Galindo Salgado2023-07-262-19/+17
|
* gh-98931: Add custom error messages to invalid import/from with multiple ↵Pablo Galindo Salgado2023-06-221-1/+1
| | | | | | targets (#105985) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-105194: Fix format specifier escaped characters in f-strings (#105231)Pablo Galindo Salgado2023-06-021-1/+1
|
* gh-104799: Move location of type_params AST fields (#104828)Jelle Zijlstra2023-05-261-6/+6
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104656: Rename typeparams AST node to type_params (#104657)Jelle Zijlstra2023-05-221-4/+4
|
* gh-102856: Python tokenizer implementation for PEP 701 (#104323)Marta Gómez Macías2023-05-211-2/+2
| | | | | | | | | | | This commit replaces the Python implementation of the tokenize module with an implementation that reuses the real C tokenizer via a private extension module. The tokenize module now implements a compatibility layer that transforms tokens from the C tokenizer into Python tokenize tokens for backward compatibility. As the C tokenizer does not emit some tokens that the Python tokenizer provides (such as comments and non-semantic newlines), a new special mode has been added to the C tokenizer mode that currently is only used via the extension module that exposes it to the Python layer. This new mode forces the C tokenizer to emit these new extra tokens and add the appropriate metadata that is needed to match the old Python implementation. Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-161-6/+40
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-103656: Transfer f-string buffers to parser to avoid use-after-free ↵Lysandros Nikolaou2023-04-271-6/+5
| | | | | (GH-103896) Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* gh-102856: Initial implementation of PEP 701 (#102855)Pablo Galindo Salgado2023-04-192-6/+52
| | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
* gh-90994: Improve error messages upon call arguments syntax errors (GH-96893)Lysandros Nikolaou2022-11-201-0/+7
|
* gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)Lysandros Nikolaou2022-11-201-1/+3
| | | Automerge-Triggered-By: GH:lysnikolaou
* gh-99153: set location on SyntaxError for try with both except and except* ↵Irit Katriel2022-11-061-2/+2
| | | | (GH-99160)
* gh-98931: Improve error message when the user types 'import x from y' ↵Pablo Galindo Salgado2022-11-011-1/+8
| | | | instead of 'from y import x' (#98932)
* gh-91210: Improve error message when non-default param follows default ↵Lysandros Nikolaou2022-09-171-8/+8
| | | | | | (GH-95933) - Improve error message when parameter without a default follows one with a default - Show same error message when positional-only params precede the default/non-default sequence
* gh-96587: Raise `SyntaxError` for PEP654 on older `feature_version` (#96588)Nikita Sobolev2022-09-051-1/+3
|
* gh-94996: Disallow lambda pos only params with feature_version < (3, 8) ↵Shantanu2022-08-121-2/+2
| | | | (GH-95934)
* gh-94996: Disallow parsing pos only params with feature_version < (3, 8) ↵Shantanu2022-08-121-2/+2
| | | | (GH-94997)
* gh-94949: Disallow parsing parenthesised ctx mgr with old feature_version ↵Shantanu2022-07-181-1/+1
| | | | | | | | | | | (#94950) * gh-94949: Disallow parsing parenthesised ctx manager with old feature_version * 📜🤖 Added by blurb_it. * Allow it with feature_version=(3, 9) as well Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-94947: Disallow parsing walrus with feature_version < (3, 8) (#94948)Shantanu2022-07-181-1/+3
| | | | | | | | | * gh-94947: Disallow parsing walrus with feature_version < (3, 8) * oops, commit the parser * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-94192: Fix error for dictionary literals with invalid expression as ↵wookie1842022-06-261-1/+1
| | | | | | | value. (#94304) * Fix error for dictionary literals with invalid expression as value. * Remove trailing whitespace
* gh-92858: Improve error message for some suites with syntax error before ':' ↵wookie1842022-06-231-8/+10
| | | | (#92894)
* gh-93671: Avoid exponential backtracking in deeply nested sequence patterns ↵Pablo Galindo Salgado2022-06-101-3/+3
| | | | | in match statements (GH-93680) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-47212: Improve error messages for un-parenthesized generator expressions ↵Matthieu Dartiailh2022-04-051-3/+3
| | | | (GH-32302)
* bpo-43224: Implement PEP 646 grammar changes (GH-31018)Matthew Rahtz2022-03-261-1/+8
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* bpo-46838: Syntax error improvements for function definitions (GH-31590)Pablo Galindo Salgado2022-03-221-9/+45
|
* Allow the parser to avoid nested processing of invalid rules (GH-31252)Pablo Galindo Salgado2022-02-101-6/+5
|
* bpo-46707: Avoid potential exponential backtracking in some syntax errors ↵Pablo Galindo Salgado2022-02-101-1/+3
| | | | (GH-31241)
* bpo-46272: Fix two heading comments in python.gram (GH-30499)Mark Dickinson2022-01-091-3/+3
| | | One typo fix and one heading change, both in comments. No functional changes.
* bpo-45292: [PEP-654] add except* (GH-29581)Irit Katriel2021-12-141-2/+15
|
* bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if ↵Pablo Galindo Salgado2021-11-241-1/+2
| | | | inside parentheses (GH-29757)
* bpo-45450: Improve syntax error for parenthesized arguments (GH-28906)Pablo Galindo Salgado2021-11-201-0/+4
|
* bpo-45727: Make the syntax error for missing comma more consistent (GH-29427)Pablo Galindo Salgado2021-11-191-2/+2
|
* bpo-45764: improve error message when missing '(' after 'def' (GH-29484)Carl Friedrich Bolz-Tereick2021-11-091-2/+2
| | | | | 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-0/+2
| | | | in a call (GH-29413)