642 lines
26 KiB
Plaintext
642 lines
26 KiB
Plaintext
---
|
|
source: compiler/parser/src/parser.rs
|
|
expression: parse_ast
|
|
---
|
|
[
|
|
Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 36,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Assign {
|
|
targets: [
|
|
Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 11,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "array_slice",
|
|
ctx: Store,
|
|
},
|
|
},
|
|
],
|
|
value: Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 14,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 36,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Subscript {
|
|
value: Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 14,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 19,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "array",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
slice: Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 20,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 35,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Tuple {
|
|
elts: [
|
|
Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 20,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 21,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Constant {
|
|
value: Int(
|
|
0,
|
|
),
|
|
kind: None,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 23,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 31,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Starred {
|
|
value: Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 24,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 31,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "indexes",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 33,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 35,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: UnaryOp {
|
|
op: USub,
|
|
operand: Located {
|
|
location: Location {
|
|
row: 1,
|
|
column: 34,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 1,
|
|
column: 35,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Constant {
|
|
value: Int(
|
|
1,
|
|
),
|
|
kind: None,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
],
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
type_comment: None,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 36,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Assign {
|
|
targets: [
|
|
Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 22,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Subscript {
|
|
value: Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 5,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "array",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
slice: Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 21,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Tuple {
|
|
elts: [
|
|
Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 7,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Constant {
|
|
value: Int(
|
|
0,
|
|
),
|
|
kind: None,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 9,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 17,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Starred {
|
|
value: Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 10,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 17,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "indexes",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 19,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 21,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: UnaryOp {
|
|
op: USub,
|
|
operand: Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 20,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 21,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Constant {
|
|
value: Int(
|
|
1,
|
|
),
|
|
kind: None,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
],
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Store,
|
|
},
|
|
},
|
|
],
|
|
value: Located {
|
|
location: Location {
|
|
row: 2,
|
|
column: 25,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 2,
|
|
column: 36,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "array_slice",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
type_comment: None,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 45,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Expr {
|
|
value: Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 45,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Subscript {
|
|
value: Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 5,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "array",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
slice: Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 44,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Tuple {
|
|
elts: [
|
|
Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 24,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Starred {
|
|
value: Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 7,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 24,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "indexes_to_select",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 26,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 44,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Starred {
|
|
value: Located {
|
|
location: Location {
|
|
row: 3,
|
|
column: 27,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 3,
|
|
column: 44,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "indexes_to_select",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
],
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 30,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Expr {
|
|
value: Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 30,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Subscript {
|
|
value: Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 0,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 5,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "array",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
slice: Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 29,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Tuple {
|
|
elts: [
|
|
Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 9,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Slice {
|
|
lower: Some(
|
|
Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 6,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 7,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Constant {
|
|
value: Int(
|
|
3,
|
|
),
|
|
kind: None,
|
|
},
|
|
},
|
|
),
|
|
upper: Some(
|
|
Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 8,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 9,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Constant {
|
|
value: Int(
|
|
5,
|
|
),
|
|
kind: None,
|
|
},
|
|
},
|
|
),
|
|
step: None,
|
|
},
|
|
},
|
|
Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 11,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 29,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Starred {
|
|
value: Located {
|
|
location: Location {
|
|
row: 4,
|
|
column: 12,
|
|
},
|
|
end_location: Some(
|
|
Location {
|
|
row: 4,
|
|
column: 29,
|
|
},
|
|
),
|
|
custom: (),
|
|
node: Name {
|
|
id: "indexes_to_select",
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
],
|
|
ctx: Load,
|
|
},
|
|
},
|
|
ctx: Load,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
]
|