Skip to content

Commit 451f06b

Browse files
[3.15] Link to existing rules in compound_stmts.rst (GH-149811) (GH-149836)
Link to existing rules in compound_stmts.rst (GH-149811) In gh-138418, `!` was added to links to rules that don't exist in the docs, in order to silence broken link warnings. However, productionlist doesn't parse the `!`, which ends up in the rendered documentation. (It's possible that gh-127835 broke the `!` support.) Replace the names with ones that appear in docs: - `star_named_expression` in the grammar corresponds to `flexible_expression` in the docs - `star_named_expressions` in the grammar corresponds to `flexible_expression_list` in the docs - `named_expression` in the grammar corresponds to `assignment_expression` in the docs Having two sets of names isn't great of course. Consolidating them is tracked in (subissues of) gh-127833. (cherry picked from commit c375292) Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 6302a8f commit 451f06b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/reference/compound_stmts.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ The match statement is used for pattern matching. Syntax:
618618

619619
.. productionlist:: python-grammar
620620
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
621-
subject_expr: `!star_named_expression` "," `!star_named_expressions`?
622-
: | `!named_expression`
621+
subject_expr: `flexible_expression` "," [`flexible_expression_list` [',']]
622+
: | `assignment_expression`
623623
case_block: 'case' `patterns` [`guard`] ":" `!block`
624624

625625
.. note::
@@ -709,7 +709,7 @@ Guards
709709
.. index:: ! guard
710710

711711
.. productionlist:: python-grammar
712-
guard: "if" `!named_expression`
712+
guard: "if" `assignment_expression`
713713

714714
A ``guard`` (which is part of the ``case``) must succeed for code inside
715715
the ``case`` block to execute. It takes the form: :keyword:`if` followed by an

0 commit comments

Comments
 (0)