Commits on Apr 5, 2022
Commits on Mar 26, 2022
-
bpo-43224: Implement PEP 646 grammar changes (GH-31018)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Commits on Feb 10, 2022
Commits on Jan 9, 2022
-
bpo-46272: Fix two heading comments in python.gram (GH-30499)
One typo fix and one heading change, both in comments. No functional changes.
Commits on Dec 14, 2021
Commits on Nov 24, 2021
-
bpo-45727: Only trigger the 'did you forgot a comma' error suggestion…
… if inside parentheses (GH-29757)
Commits on Nov 5, 2021
-
bpo-45716: Improve the error message when using True/False/None as ke…
…ywords in a call (GH-29413)
Commits on Sep 27, 2021
-
bpo-43914: Correctly highlight SyntaxError exceptions for invalid gen…
…erator expression in function calls (GH-28576)
Commits on Aug 18, 2021
Commits on Aug 5, 2021
Commits on Aug 1, 2021
-
bpo-34013: Don't consider a grouped expression when reporting legacy …
…print syntax errors (GH-27521)
Commits on Jul 31, 2021
Commits on Jul 16, 2021
Commits on Jun 24, 2021
Commits on Jun 10, 2021
-
bpo-44385: Remove unused grammar rules (GH-26655)
Automerge-Triggered-By: GH:lysnikolaou
Commits on Jun 3, 2021
Commits on May 21, 2021
-
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.
Commits on May 19, 2021
-
bpo-44168: Fix error message in the parser for keyword arguments for …
…invalid expressions (GH-26210)
Commits on May 8, 2021
-
bpo-43149: Correct the syntax error message for multiple exception ty…
…pes (GH-25996) Automerge-Triggered-By: GH:pablogsal
Commits on Apr 30, 2021
Commits on Apr 29, 2021
-
bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Commits on Apr 23, 2021
-
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