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_target.py
---
## AST

```
Module(
    ModModule {
        node_index: NodeIndex(None),
        range: 0..59,
        body: [
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 0..6,
                    target: NumberLiteral(
                        ExprNumberLiteral {
                            node_index: NodeIndex(None),
                            range: 0..1,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                    op: Add,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            node_index: NodeIndex(None),
                            range: 5..6,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 7..17,
                    target: StringLiteral(
                        ExprStringLiteral {
                            node_index: NodeIndex(None),
                            range: 7..10,
                            value: StringLiteralValue {
                                inner: Single(
                                    StringLiteral {
                                        range: 7..10,
                                        node_index: NodeIndex(None),
                                        value: "a",
                                        flags: StringLiteralFlags {
                                            quote_style: Double,
                                            prefix: Empty,
                                            triple_quoted: false,
                                            unclosed: false,
                                        },
                                    },
                                ),
                            },
                        },
                    ),
                    op: Add,
                    value: StringLiteral(
                        ExprStringLiteral {
                            node_index: NodeIndex(None),
                            range: 14..17,
                            value: StringLiteralValue {
                                inner: Single(
                                    StringLiteral {
                                        range: 14..17,
                                        node_index: NodeIndex(None),
                                        value: "b",
                                        flags: StringLiteralFlags {
                                            quote_style: Double,
                                            prefix: Empty,
                                            triple_quoted: false,
                                            unclosed: false,
                                        },
                                    },
                                ),
                            },
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 18..25,
                    target: Starred(
                        ExprStarred {
                            node_index: NodeIndex(None),
                            range: 18..20,
                            value: Name(
                                ExprName {
                                    node_index: NodeIndex(None),
                                    range: 19..20,
                                    id: Name("x"),
                                    ctx: Store,
                                },
                            ),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            node_index: NodeIndex(None),
                            range: 24..25,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            Pass(
                StmtPass {
                    node_index: NodeIndex(None),
                    range: 26..30,
                },
            ),
            Expr(
                StmtExpr {
                    node_index: NodeIndex(None),
                    range: 34..35,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            node_index: NodeIndex(None),
                            range: 34..35,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 36..45,
                    target: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 36..37,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    op: Add,
                    value: Name(
                        ExprName {
                            node_index: NodeIndex(None),
                            range: 41..45,
                            id: Name("pass"),
                            ctx: Load,
                        },
                    ),
                },
            ),
            AugAssign(
                StmtAugAssign {
                    node_index: NodeIndex(None),
                    range: 46..58,
                    target: BinOp(
                        ExprBinOp {
                            node_index: NodeIndex(None),
                            range: 47..52,
                            left: Name(
                                ExprName {
                                    node_index: NodeIndex(None),
                                    range: 47..48,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            op: Add,
                            right: Name(
                                ExprName {
                                    node_index: NodeIndex(None),
                                    range: 51..52,
                                    id: Name("y"),
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                    op: Add,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            node_index: NodeIndex(None),
                            range: 57..58,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | 1 += 1
  | ^ Syntax Error: Invalid augmented assignment target
2 | "a" += "b"
3 | *x += 1
  |


  |
1 | 1 += 1
2 | "a" += "b"
  | ^^^ Syntax Error: Invalid augmented assignment target
3 | *x += 1
4 | pass += 1
  |


  |
1 | 1 += 1
2 | "a" += "b"
3 | *x += 1
  | ^^ Syntax Error: Invalid augmented assignment target
4 | pass += 1
5 | x += pass
  |


  |
2 | "a" += "b"
3 | *x += 1
4 | pass += 1
  |      ^^ Syntax Error: Expected a statement
5 | x += pass
6 | (x + y) += 1
  |


  |
3 | *x += 1
4 | pass += 1
5 | x += pass
  |      ^^^^ Syntax Error: Expected an identifier, but found a keyword `pass` that cannot be used here
6 | (x + y) += 1
  |


  |
4 | pass += 1
5 | x += pass
6 | (x + y) += 1
  |  ^^^^^ Syntax Error: Invalid augmented assignment target
  |