---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/statements/match/as_pattern_0.py
---
## AST

```
Module(
    ModModule {
        range: 0..198,
        body: [
            Match(
                StmtMatch {
                    range: 0..197,
                    subject: Name(
                        ExprName {
                            range: 6..13,
                            id: "subject",
                            ctx: Load,
                        },
                    ),
                    cases: [
                        MatchCase {
                            range: 127..197,
                            pattern: MatchClass(
                                PatternMatchClass {
                                    range: 132..146,
                                    cls: Name(
                                        ExprName {
                                            range: 133..139,
                                            id: "",
                                            ctx: Invalid,
                                        },
                                    ),
                                    arguments: PatternArguments {
                                        range: 140..146,
                                        patterns: [
                                            MatchAs(
                                                PatternMatchAs {
                                                    range: 141..142,
                                                    pattern: None,
                                                    name: Some(
                                                        Identifier {
                                                            id: "a",
                                                            range: 141..142,
                                                        },
                                                    ),
                                                },
                                            ),
                                            MatchAs(
                                                PatternMatchAs {
                                                    range: 144..145,
                                                    pattern: None,
                                                    name: Some(
                                                        Identifier {
                                                            id: "b",
                                                            range: 144..145,
                                                        },
                                                    ),
                                                },
                                            ),
                                        ],
                                        keywords: [],
                                    },
                                },
                            ),
                            guard: None,
                            body: [
                                Pass(
                                    StmtPass {
                                        range: 193..197,
                                    },
                                ),
                            ],
                        },
                    ],
                },
            ),
        ],
    },
)
```
## Errors

  |
3 |     #            class pattern
4 |     #            v
5 |     case (x as y)(a, b):
  |           ^^^^^^ Syntax Error: Invalid value for a class pattern
6 |     #     ^^^^^^
7 |     #    as-pattern
  |
