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

```
Module(
    ModModule {
        node_index: AtomicNodeIndex(..),
        range: 0..33,
        body: [
            Match(
                StmtMatch {
                    node_index: AtomicNodeIndex(..),
                    range: 0..32,
                    subject: Yield(
                        ExprYield {
                            node_index: AtomicNodeIndex(..),
                            range: 6..15,
                            value: Some(
                                Name(
                                    ExprName {
                                        node_index: AtomicNodeIndex(..),
                                        range: 12..15,
                                        id: Name("foo"),
                                        ctx: Load,
                                    },
                                ),
                            ),
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 21..32,
                            node_index: AtomicNodeIndex(..),
                            pattern: MatchAs(
                                PatternMatchAs {
                                    range: 26..27,
                                    node_index: AtomicNodeIndex(..),
                                    pattern: None,
                                    name: None,
                                },
                            ),
                            guard: None,
                            body: [
                                Expr(
                                    StmtExpr {
                                        node_index: AtomicNodeIndex(..),
                                        range: 29..32,
                                        value: EllipsisLiteral(
                                            ExprEllipsisLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 29..32,
                                            },
                                        ),
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | match yield foo:
  |       ^^^^^^^^^ Syntax Error: Yield expression cannot be used here
2 |     case _: ...
  |
