ruff/parser/src/snapshots/rustpython_parser__with__te...

2095 lines
72 KiB
Plaintext

---
source: compiler/parser/src/with.rs
expression: "parse_program(source, \"<test>\").unwrap()"
---
[
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 2,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 2,
column: 0,
},
end_location: Some(
Location {
row: 3,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 2,
column: 5,
},
end_location: Some(
Location {
row: 2,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: Some(
Located {
location: Location {
row: 2,
column: 10,
},
end_location: Some(
Location {
row: 2,
column: 11,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 2,
column: 13,
},
end_location: Some(
Location {
row: 2,
column: 17,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 3,
column: 0,
},
end_location: Some(
Location {
row: 4,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 3,
column: 5,
},
end_location: Some(
Location {
row: 3,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: None,
},
Withitem {
context_expr: Located {
location: Location {
row: 3,
column: 8,
},
end_location: Some(
Location {
row: 3,
column: 9,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 3,
column: 11,
},
end_location: Some(
Location {
row: 3,
column: 15,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 4,
column: 0,
},
end_location: Some(
Location {
row: 5,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 4,
column: 5,
},
end_location: Some(
Location {
row: 4,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: Some(
Located {
location: Location {
row: 4,
column: 10,
},
end_location: Some(
Location {
row: 4,
column: 11,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
Withitem {
context_expr: Located {
location: Location {
row: 4,
column: 13,
},
end_location: Some(
Location {
row: 4,
column: 14,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
optional_vars: Some(
Located {
location: Location {
row: 4,
column: 18,
},
end_location: Some(
Location {
row: 4,
column: 19,
},
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 4,
column: 21,
},
end_location: Some(
Location {
row: 4,
column: 25,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 5,
column: 0,
},
end_location: Some(
Location {
row: 6,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 5,
column: 7,
},
end_location: Some(
Location {
row: 5,
column: 18,
},
),
custom: (),
node: IfExp {
test: Located {
location: Location {
row: 5,
column: 10,
},
end_location: Some(
Location {
row: 5,
column: 11,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
body: Located {
location: Location {
row: 5,
column: 5,
},
end_location: Some(
Location {
row: 5,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
orelse: Located {
location: Location {
row: 5,
column: 17,
},
end_location: Some(
Location {
row: 5,
column: 18,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 5,
column: 20,
},
end_location: Some(
Location {
row: 5,
column: 24,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 6,
column: 0,
},
end_location: Some(
Location {
row: 7,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 6,
column: 7,
},
end_location: Some(
Location {
row: 6,
column: 18,
},
),
custom: (),
node: IfExp {
test: Located {
location: Location {
row: 6,
column: 10,
},
end_location: Some(
Location {
row: 6,
column: 11,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
body: Located {
location: Location {
row: 6,
column: 5,
},
end_location: Some(
Location {
row: 6,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
orelse: Located {
location: Location {
row: 6,
column: 17,
},
end_location: Some(
Location {
row: 6,
column: 18,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
},
},
optional_vars: Some(
Located {
location: Location {
row: 6,
column: 22,
},
end_location: Some(
Location {
row: 6,
column: 23,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 6,
column: 25,
},
end_location: Some(
Location {
row: 6,
column: 29,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 7,
column: 0,
},
end_location: Some(
Location {
row: 8,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 7,
column: 5,
},
end_location: Some(
Location {
row: 7,
column: 7,
},
),
custom: (),
node: Tuple {
elts: [],
ctx: Load,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 7,
column: 9,
},
end_location: Some(
Location {
row: 7,
column: 13,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 8,
column: 0,
},
end_location: Some(
Location {
row: 9,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 8,
column: 5,
},
end_location: Some(
Location {
row: 8,
column: 7,
},
),
custom: (),
node: Tuple {
elts: [],
ctx: Load,
},
},
optional_vars: Some(
Located {
location: Location {
row: 8,
column: 11,
},
end_location: Some(
Location {
row: 8,
column: 12,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 8,
column: 14,
},
end_location: Some(
Location {
row: 8,
column: 18,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 9,
column: 0,
},
end_location: Some(
Location {
row: 10,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 9,
column: 6,
},
end_location: Some(
Location {
row: 9,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 9,
column: 10,
},
end_location: Some(
Location {
row: 9,
column: 14,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 10,
column: 0,
},
end_location: Some(
Location {
row: 11,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 10,
column: 6,
},
end_location: Some(
Location {
row: 10,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: Some(
Located {
location: Location {
row: 10,
column: 12,
},
end_location: Some(
Location {
row: 10,
column: 13,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 10,
column: 15,
},
end_location: Some(
Location {
row: 10,
column: 19,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 11,
column: 0,
},
end_location: Some(
Location {
row: 12,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 11,
column: 6,
},
end_location: Some(
Location {
row: 11,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 11,
column: 11,
},
end_location: Some(
Location {
row: 11,
column: 15,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 12,
column: 0,
},
end_location: Some(
Location {
row: 13,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 12,
column: 6,
},
end_location: Some(
Location {
row: 12,
column: 8,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 12,
column: 6,
},
end_location: Some(
Location {
row: 12,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
],
ctx: Load,
},
},
optional_vars: Some(
Located {
location: Location {
row: 12,
column: 13,
},
end_location: Some(
Location {
row: 12,
column: 14,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 12,
column: 16,
},
end_location: Some(
Location {
row: 12,
column: 20,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 13,
column: 0,
},
end_location: Some(
Location {
row: 14,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 13,
column: 6,
},
end_location: Some(
Location {
row: 13,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
optional_vars: None,
},
Withitem {
context_expr: Located {
location: Location {
row: 13,
column: 9,
},
end_location: Some(
Location {
row: 13,
column: 10,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 13,
column: 13,
},
end_location: Some(
Location {
row: 13,
column: 17,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 14,
column: 0,
},
end_location: Some(
Location {
row: 15,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 14,
column: 6,
},
end_location: Some(
Location {
row: 14,
column: 10,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 14,
column: 6,
},
end_location: Some(
Location {
row: 14,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
Located {
location: Location {
row: 14,
column: 9,
},
end_location: Some(
Location {
row: 14,
column: 10,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
],
ctx: Load,
},
},
optional_vars: Some(
Located {
location: Location {
row: 14,
column: 15,
},
end_location: Some(
Location {
row: 14,
column: 16,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 14,
column: 18,
},
end_location: Some(
Location {
row: 14,
column: 22,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 15,
column: 0,
},
end_location: Some(
Location {
row: 16,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 15,
column: 6,
},
end_location: Some(
Location {
row: 15,
column: 9,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 15,
column: 6,
},
end_location: Some(
Location {
row: 15,
column: 8,
},
),
custom: (),
node: Starred {
value: Located {
location: Location {
row: 15,
column: 7,
},
end_location: Some(
Location {
row: 15,
column: 8,
},
),
custom: (),
node: Name {
id: "a",
ctx: Load,
},
},
ctx: Load,
},
},
],
ctx: Load,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 15,
column: 12,
},
end_location: Some(
Location {
row: 15,
column: 16,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 16,
column: 0,
},
end_location: Some(
Location {
row: 17,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 16,
column: 6,
},
end_location: Some(
Location {
row: 16,
column: 9,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 16,
column: 6,
},
end_location: Some(
Location {
row: 16,
column: 8,
},
),
custom: (),
node: Starred {
value: Located {
location: Location {
row: 16,
column: 7,
},
end_location: Some(
Location {
row: 16,
column: 8,
},
),
custom: (),
node: Name {
id: "a",
ctx: Load,
},
},
ctx: Load,
},
},
],
ctx: Load,
},
},
optional_vars: Some(
Located {
location: Location {
row: 16,
column: 14,
},
end_location: Some(
Location {
row: 16,
column: 15,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 16,
column: 17,
},
end_location: Some(
Location {
row: 16,
column: 21,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 17,
column: 0,
},
end_location: Some(
Location {
row: 18,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 17,
column: 6,
},
end_location: Some(
Location {
row: 17,
column: 11,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 17,
column: 6,
},
end_location: Some(
Location {
row: 17,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
Located {
location: Location {
row: 17,
column: 9,
},
end_location: Some(
Location {
row: 17,
column: 11,
},
),
custom: (),
node: Starred {
value: Located {
location: Location {
row: 17,
column: 10,
},
end_location: Some(
Location {
row: 17,
column: 11,
},
),
custom: (),
node: Name {
id: "a",
ctx: Load,
},
},
ctx: Load,
},
},
],
ctx: Load,
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 17,
column: 14,
},
end_location: Some(
Location {
row: 17,
column: 18,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 18,
column: 0,
},
end_location: Some(
Location {
row: 19,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 18,
column: 6,
},
end_location: Some(
Location {
row: 18,
column: 11,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 18,
column: 6,
},
end_location: Some(
Location {
row: 18,
column: 7,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
Located {
location: Location {
row: 18,
column: 9,
},
end_location: Some(
Location {
row: 18,
column: 11,
},
),
custom: (),
node: Starred {
value: Located {
location: Location {
row: 18,
column: 10,
},
end_location: Some(
Location {
row: 18,
column: 11,
},
),
custom: (),
node: Name {
id: "a",
ctx: Load,
},
},
ctx: Load,
},
},
],
ctx: Load,
},
},
optional_vars: Some(
Located {
location: Location {
row: 18,
column: 16,
},
end_location: Some(
Location {
row: 18,
column: 17,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 18,
column: 19,
},
end_location: Some(
Location {
row: 18,
column: 23,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 19,
column: 0,
},
end_location: Some(
Location {
row: 20,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 19,
column: 6,
},
end_location: Some(
Location {
row: 19,
column: 12,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 19,
column: 6,
},
end_location: Some(
Location {
row: 19,
column: 12,
},
),
custom: (),
node: Name {
id: "a",
ctx: Store,
},
},
value: Located {
location: Location {
row: 19,
column: 11,
},
end_location: Some(
Location {
row: 19,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 19,
column: 15,
},
end_location: Some(
Location {
row: 19,
column: 19,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 20,
column: 0,
},
end_location: Some(
Location {
row: 21,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 20,
column: 6,
},
end_location: Some(
Location {
row: 20,
column: 12,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 20,
column: 6,
},
end_location: Some(
Location {
row: 20,
column: 12,
},
),
custom: (),
node: Name {
id: "a",
ctx: Store,
},
},
value: Located {
location: Location {
row: 20,
column: 11,
},
end_location: Some(
Location {
row: 20,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
},
},
optional_vars: Some(
Located {
location: Location {
row: 20,
column: 17,
},
end_location: Some(
Location {
row: 20,
column: 18,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 20,
column: 20,
},
end_location: Some(
Location {
row: 20,
column: 24,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 21,
column: 0,
},
end_location: Some(
Location {
row: 22,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 21,
column: 6,
},
end_location: Some(
Location {
row: 21,
column: 12,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 21,
column: 6,
},
end_location: Some(
Location {
row: 21,
column: 12,
},
),
custom: (),
node: Name {
id: "a",
ctx: Store,
},
},
value: Located {
location: Location {
row: 21,
column: 11,
},
end_location: Some(
Location {
row: 21,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
},
},
optional_vars: None,
},
Withitem {
context_expr: Located {
location: Location {
row: 21,
column: 14,
},
end_location: Some(
Location {
row: 21,
column: 20,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 21,
column: 14,
},
end_location: Some(
Location {
row: 21,
column: 20,
},
),
custom: (),
node: Name {
id: "b",
ctx: Store,
},
},
value: Located {
location: Location {
row: 21,
column: 19,
},
end_location: Some(
Location {
row: 21,
column: 20,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
},
},
optional_vars: None,
},
],
body: [
Located {
location: Location {
row: 21,
column: 23,
},
end_location: Some(
Location {
row: 21,
column: 27,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
Located {
location: Location {
row: 22,
column: 0,
},
end_location: Some(
Location {
row: 23,
column: 0,
},
),
custom: (),
node: With {
items: [
Withitem {
context_expr: Located {
location: Location {
row: 22,
column: 6,
},
end_location: Some(
Location {
row: 22,
column: 20,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 22,
column: 6,
},
end_location: Some(
Location {
row: 22,
column: 12,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 22,
column: 6,
},
end_location: Some(
Location {
row: 22,
column: 12,
},
),
custom: (),
node: Name {
id: "a",
ctx: Store,
},
},
value: Located {
location: Location {
row: 22,
column: 11,
},
end_location: Some(
Location {
row: 22,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
},
},
},
},
Located {
location: Location {
row: 22,
column: 14,
},
end_location: Some(
Location {
row: 22,
column: 20,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 22,
column: 14,
},
end_location: Some(
Location {
row: 22,
column: 20,
},
),
custom: (),
node: Name {
id: "b",
ctx: Store,
},
},
value: Located {
location: Location {
row: 22,
column: 19,
},
end_location: Some(
Location {
row: 22,
column: 20,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
},
},
],
ctx: Load,
},
},
optional_vars: Some(
Located {
location: Location {
row: 22,
column: 25,
},
end_location: Some(
Location {
row: 22,
column: 26,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
),
},
],
body: [
Located {
location: Location {
row: 22,
column: 28,
},
end_location: Some(
Location {
row: 22,
column: 32,
},
),
custom: (),
node: Pass,
},
],
type_comment: None,
},
},
]