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/err/aug_assign_stmt_invalid_value.py
---
## AST

```
Module(
    ModModule {
        node_index: NodeIndex(None),
        range: 0..77,
        body: [
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 0..13,
                    target: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 0..1,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: Starred(
                        ExprStarred {
                            node_index: NodeIndex(None),
                            range: 5..13,
                            value: BoolOp(
                                ExprBoolOp {
                                    node_index: NodeIndex(None),
                                    range: 6..13,
                                    op: And,
                                    values: [
                                        Name(
                                            ExprName {
                                                node_index: NodeIndex(None),
                                                range: 6..7,
                                                id: Name("a"),
                                                ctx: Load,
                                            },
                                        ),
                                        Name(
                                            ExprName {
                                                node_index: NodeIndex(None),
                                                range: 12..13,
                                                id: Name("b"),
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 14..27,
                    target: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 14..15,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: Starred(
                        ExprStarred {
                            node_index: NodeIndex(None),
                            range: 19..27,
                            value: Yield(
                                ExprYield {
                                    node_index: NodeIndex(None),
                                    range: 20..27,
                                    value: Some(
                                        Name(
                                            ExprName {
                                                node_index: NodeIndex(None),
                                                range: 26..27,
                                                id: Name("x"),
                                                ctx: Load,
                                            },
                                        ),
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 28..46,
                    target: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 28..29,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: Starred(
                        ExprStarred {
                            node_index: NodeIndex(None),
                            range: 33..46,
                            value: YieldFrom(
                                ExprYieldFrom {
                                    node_index: NodeIndex(None),
                                    range: 34..46,
                                    value: Name(
                                        ExprName {
                                            node_index: NodeIndex(None),
                                            range: 45..46,
                                            id: Name("x"),
                                            ctx: Load,
                                        },
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 47..64,
                    target: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 47..48,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: Starred(
                        ExprStarred {
                            node_index: NodeIndex(None),
                            range: 52..64,
                            value: Lambda(
                                ExprLambda {
                                    node_index: NodeIndex(None),
                                    range: 53..64,
                                    parameters: Some(
                                        Parameters {
                                            range: 60..61,
                                            node_index: NodeIndex(None),
                                            posonlyargs: [],
                                            args: [
                                                ParameterWithDefault {
                                                    range: 60..61,
                                                    node_index: NodeIndex(None),
                                                    parameter: Parameter {
                                                        range: 60..61,
                                                        node_index: NodeIndex(None),
                                                        name: Identifier {
                                                            id: Name("x"),
                                                            range: 60..61,
                                                            node_index: NodeIndex(None),
                                                        },
                                                        annotation: None,
                                                    },
                                                    default: None,
                                                },
                                            ],
                                            vararg: None,
                                            kwonlyargs: [],
                                            kwarg: None,
                                        },
                                    ),
                                    body: Name(
                                        ExprName {
                                            node_index: NodeIndex(None),
                                            range: 63..64,
                                            id: Name("x"),
                                            ctx: Load,
                                        },
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 65..71,
                    target: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 65..66,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 70..71,
                            id: Name("y"),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: NodeIndex(None),
                    range: 75..76,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            node_index: NodeIndex(None),
                            range: 75..76,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | x += *a and b
  |       ^^^^^^^ Syntax Error: Boolean expression cannot be used here
2 | x += *yield x
3 | x += *yield from x
  |


  |
1 | x += *a and b
2 | x += *yield x
  |       ^^^^^^^ Syntax Error: Yield expression cannot be used here
3 | x += *yield from x
4 | x += *lambda x: x
  |


  |
1 | x += *a and b
2 | x += *yield x
3 | x += *yield from x
  |       ^^^^^^^^^^^^ Syntax Error: Yield expression cannot be used here
4 | x += *lambda x: x
5 | x += y := 1
  |


  |
2 | x += *yield x
3 | x += *yield from x
4 | x += *lambda x: x
  |       ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here
5 | x += y := 1
  |


  |
3 | x += *yield from x
4 | x += *lambda x: x
5 | x += y := 1
  |        ^^ Syntax Error: Expected a statement
  |