Skip to content

Commits on Jun 10, 2022

  1. gh-93671: Avoid exponential backtracking in deeply nested sequence pa…

    …tterns in match statements (GH-93680)
    
    Co-authored-by: Łukasz Langa <lukasz@langa.pl>
    pablogsal and ambv committed Jun 10, 2022

Commits on Mar 26, 2022

  1. bpo-43224: Implement PEP 646 grammar changes (GH-31018)

    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    mrahtz and JelleZijlstra committed Mar 26, 2022

Commits on Jan 9, 2022

  1. bpo-46272: Fix two heading comments in python.gram (GH-30499)

    One typo fix and one heading change, both in comments. No functional changes.
    mdickinson committed Jan 9, 2022

Commits on Dec 14, 2021

Commits on Nov 24, 2021

Commits on Nov 9, 2021

  1. bpo-45764: improve error message when missing '(' after 'def' (GH-29484)

    to achieve this, change the grammar to expect the '(' token after 'def' NAME.
    
    Automerge-Triggered-By: GH:pablogsal
    cfbolz committed Nov 9, 2021

Commits on Nov 5, 2021

Commits on Nov 3, 2021

  1. bpo-44257: fix "assigment_expr" typo + regenerate the grammar, and re…

    …move unused imports (GH-29393)
    
    
    Co-authored-by: Wim Glenn <wglenn@jumptrading.com>
    wimglenn and wimglenn committed Nov 3, 2021

Commits on Sep 27, 2021

  1. bpo-43914: Correctly highlight SyntaxError exceptions for invalid gen…

    …erator expression in function calls (GH-28576)
    pablogsal committed Sep 27, 2021

Commits on Aug 1, 2021

Commits on Jun 10, 2021

  1. bpo-44385: Remove unused grammar rules (GH-26655)

    Automerge-Triggered-By: GH:lysnikolaou
    lysnikolaou committed Jun 10, 2021

Commits on May 21, 2021

  1. bpo-44180: Fix edge cases in invalid assigment rules in the parser (G…

    …H-26283)
    
    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.
    pablogsal committed May 21, 2021

Commits on May 19, 2021

Commits on May 8, 2021

  1. bpo-43149: Correct the syntax error message for multiple exception ty…

    …pes (GH-25996)
    
    Automerge-Triggered-By: GH:pablogsal
    pablogsal committed May 8, 2021

Commits on Apr 29, 2021

  1. bpo-43892: Make match patterns explicit in the AST (GH-25585)

    Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
    ncoghlan and brandtbucher committed Apr 29, 2021

Commits on Apr 23, 2021

  1. bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525)

    To improve the user experience understanding what part of the error messages associated with SyntaxErrors is wrong, we can highlight the whole error range and not only place the caret at the first character. In this way:
    
    >>> foo(x, z for z in range(10), t, w)
      File "<stdin>", line 1
        foo(x, z for z in range(10), t, w)
               ^
    SyntaxError: Generator expression must be parenthesized
    
    becomes
    
    >>> foo(x, z for z in range(10), t, w)
      File "<stdin>", line 1
        foo(x, z for z in range(10), t, w)
               ^^^^^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    pablogsal committed Apr 23, 2021
Older