ruff/crates/ruff_python_parser/tests/snapshots/invalid_syntax@walrus_py37....

48 lines
1.3 KiB
Plaintext

---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/walrus_py37.py
---
## AST
```
Module(
ModModule {
range: 0..54,
body: [
Expr(
StmtExpr {
range: 45..53,
value: Named(
ExprNamed {
range: 46..52,
target: Name(
ExprName {
range: 46..47,
id: Name("x"),
ctx: Store,
},
),
value: NumberLiteral(
ExprNumberLiteral {
range: 51..52,
value: Int(
1,
),
},
),
},
),
},
),
],
},
)
```
## Unsupported Syntax Errors
|
1 | # parse_options: { "target-version": "3.7" }
2 | (x := 1)
| ^^^^^^ Syntax Error: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8)
|