rustpython-ruff_python_parser 0.15.8

Unofficial fork for RustPython
Documentation
---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/ok/match_stmt_subject_expr.py
---
## AST

```
Module(
    ModModule {
        node_index: NodeIndex(None),
        range: 0..185,
        body: [
            Match(
                StmtMatch {
                    node_index: NodeIndex(None),
                    range: 0..29,
                    subject: Named(
                        ExprNamed {
                            node_index: NodeIndex(None),
                            range: 6..12,
                            target: Name(
                                ExprName {
                                    node_index: NodeIndex(None),
                                    range: 6..7,
                                    id: Name("x"),
                                    ctx: Store,
                                },
                            ),
                            value: NumberLiteral(
                                ExprNumberLiteral {
                                    node_index: NodeIndex(None),
                                    range: 11..12,
                                    value: Int(
                                        1,
                                    ),
                                },
                            ),
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 18..29,
                            node_index: NodeIndex(None),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    node_index: NodeIndex(None),
                                    range: 23..24,
                                    pattern: None,
                                    name: None,
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: NodeIndex(None),
                                        range: 26..29,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: NodeIndex(None),
                                                range: 26..29,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
            Match(
                StmtMatch {
                    node_index: NodeIndex(None),
                    range: 30..61,
                    subject: Named(
                        ExprNamed {
                            node_index: NodeIndex(None),
                            range: 37..43,
                            target: Name(
                                ExprName {
                                    node_index: NodeIndex(None),
                                    range: 37..38,
                                    id: Name("x"),
                                    ctx: Store,
                                },
                            ),
                            value: NumberLiteral(
                                ExprNumberLiteral {
                                    node_index: NodeIndex(None),
                                    range: 42..43,
                                    value: Int(
                                        1,
                                    ),
                                },
                            ),
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 50..61,
                            node_index: NodeIndex(None),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    node_index: NodeIndex(None),
                                    range: 55..56,
                                    pattern: None,
                                    name: None,
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: NodeIndex(None),
                                        range: 58..61,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: NodeIndex(None),
                                                range: 58..61,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
            Match(
                StmtMatch {
                    node_index: NodeIndex(None),
                    range: 121..153,
                    subject: Tuple(
                        ExprTuple {
                            node_index: NodeIndex(None),
                            range: 127..136,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        node_index: NodeIndex(None),
                                        range: 127..133,
                                        value: BinOp(
                                            ExprBinOp {
                                                node_index: NodeIndex(None),
                                                range: 128..133,
                                                left: Name(
                                                    ExprName {
                                                        node_index: NodeIndex(None),
                                                        range: 128..129,
                                                        id: Name("x"),
                                                        ctx: Load,
                                                    },
                                                ),
                                                op: BitOr,
                                                right: Name(
                                                    ExprName {
                                                        node_index: NodeIndex(None),
                                                        range: 132..133,
                                                        id: Name("y"),
                                                        ctx: Load,
                                                    },
                                                ),
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        node_index: NodeIndex(None),
                                        range: 135..136,
                                        id: Name("z"),
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: false,
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 142..153,
                            node_index: NodeIndex(None),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    node_index: NodeIndex(None),
                                    range: 147..148,
                                    pattern: None,
                                    name: None,
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: NodeIndex(None),
                                        range: 150..153,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: NodeIndex(None),
                                                range: 150..153,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
            Match(
                StmtMatch {
                    node_index: NodeIndex(None),
                    range: 154..184,
                    subject: Await(
                        ExprAwait {
                            node_index: NodeIndex(None),
                            range: 160..167,
                            value: Name(
                                ExprName {
                                    node_index: NodeIndex(None),
                                    range: 166..167,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 173..184,
                            node_index: NodeIndex(None),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    node_index: NodeIndex(None),
                                    range: 178..179,
                                    pattern: None,
                                    name: None,
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: NodeIndex(None),
                                        range: 181..184,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: NodeIndex(None),
                                                range: 181..184,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
        ],
    },
)
```