---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/ok/match_as_pattern_soft_keyword.py
---
## AST

```
Module(
    ModModule {
        node_index: AtomicNodeIndex(..),
        range: 0..91,
        body: [
            Match(
                StmtMatch {
                    node_index: AtomicNodeIndex(..),
                    range: 0..29,
                    subject: Name(
                        ExprName {
                            node_index: AtomicNodeIndex(..),
                            range: 6..9,
                            id: Name("foo"),
                            ctx: Load,
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 15..29,
                            node_index: AtomicNodeIndex(..),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    range: 20..24,
                                    node_index: AtomicNodeIndex(..),
                                    pattern: None,
                                    name: Some(
                                        Identifier {
                                            id: Name("case"),
                                            range: 20..24,
                                            node_index: AtomicNodeIndex(..),
                                        },
                                    ),
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: AtomicNodeIndex(..),
                                        range: 26..29,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 26..29,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
            Match(
                StmtMatch {
                    node_index: AtomicNodeIndex(..),
                    range: 30..60,
                    subject: Name(
                        ExprName {
                            node_index: AtomicNodeIndex(..),
                            range: 36..39,
                            id: Name("foo"),
                            ctx: Load,
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 45..60,
                            node_index: AtomicNodeIndex(..),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    range: 50..55,
                                    node_index: AtomicNodeIndex(..),
                                    pattern: None,
                                    name: Some(
                                        Identifier {
                                            id: Name("match"),
                                            range: 50..55,
                                            node_index: AtomicNodeIndex(..),
                                        },
                                    ),
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: AtomicNodeIndex(..),
                                        range: 57..60,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 57..60,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
            Match(
                StmtMatch {
                    node_index: AtomicNodeIndex(..),
                    range: 61..90,
                    subject: Name(
                        ExprName {
                            node_index: AtomicNodeIndex(..),
                            range: 67..70,
                            id: Name("foo"),
                            ctx: Load,
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 76..90,
                            node_index: AtomicNodeIndex(..),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    range: 81..85,
                                    node_index: AtomicNodeIndex(..),
                                    pattern: None,
                                    name: Some(
                                        Identifier {
                                            id: Name("type"),
                                            range: 81..85,
                                            node_index: AtomicNodeIndex(..),
                                        },
                                    ),
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: AtomicNodeIndex(..),
                                        range: 87..90,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 87..90,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
        ],
    },
)
```
