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

```
Module(
    ModModule {
        range: 0..57,
        body: [
            Raise(
                StmtRaise {
                    range: 0..15,
                    exc: Some(
                        Name(
                            ExprName {
                                range: 6..7,
                                id: "x",
                                ctx: Load,
                            },
                        ),
                    ),
                    cause: Some(
                        Starred(
                            ExprStarred {
                                range: 13..15,
                                value: Name(
                                    ExprName {
                                        range: 14..15,
                                        id: "y",
                                        ctx: Load,
                                    },
                                ),
                                ctx: Load,
                            },
                        ),
                    ),
                },
            ),
            Raise(
                StmtRaise {
                    range: 16..36,
                    exc: Some(
                        Name(
                            ExprName {
                                range: 22..23,
                                id: "x",
                                ctx: Load,
                            },
                        ),
                    ),
                    cause: Some(
                        Yield(
                            ExprYield {
                                range: 29..36,
                                value: Some(
                                    Name(
                                        ExprName {
                                            range: 35..36,
                                            id: "y",
                                            ctx: Load,
                                        },
                                    ),
                                ),
                            },
                        ),
                    ),
                },
            ),
            Raise(
                StmtRaise {
                    range: 37..51,
                    exc: Some(
                        Name(
                            ExprName {
                                range: 43..44,
                                id: "x",
                                ctx: Load,
                            },
                        ),
                    ),
                    cause: Some(
                        Name(
                            ExprName {
                                range: 50..51,
                                id: "y",
                                ctx: Load,
                            },
                        ),
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 55..56,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            range: 55..56,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | raise x from *y
  |              ^^ Syntax Error: Starred expression cannot be used here
2 | raise x from yield y
3 | raise x from y := 1
  |


  |
1 | raise x from *y
2 | raise x from yield y
  |              ^^^^^^^ Syntax Error: Yield expression cannot be used here
3 | raise x from y := 1
  |


  |
1 | raise x from *y
2 | raise x from yield y
3 | raise x from y := 1
  |                ^^ Syntax Error: Expected a statement
  |
