2021-11-04 15:03:34 +08:00
|
|
|
---
|
|
|
|
source: nac3parser/src/parser.rs
|
2021-12-26 00:23:54 +08:00
|
|
|
assertion_line: 186
|
2021-12-28 01:38:16 +08:00
|
|
|
expression: "parse_program(&source, Default::default()).unwrap()"
|
2021-11-04 15:03:34 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
[
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 1,
|
|
|
|
column: 1,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: AnnAssign {
|
|
|
|
target: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 1,
|
|
|
|
column: 1,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Name {
|
|
|
|
id: "a",
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
annotation: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 1,
|
|
|
|
column: 4,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Name {
|
|
|
|
id: "int",
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
value: None,
|
|
|
|
simple: true,
|
|
|
|
config_comment: [
|
|
|
|
"sf1",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 2,
|
|
|
|
column: 1,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: For {
|
|
|
|
target: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 3,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Name {
|
|
|
|
id: "i",
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
iter: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 3,
|
|
|
|
column: 11,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Tuple {
|
|
|
|
elts: [
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 3,
|
|
|
|
column: 11,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Int(
|
2021-12-26 00:23:54 +08:00
|
|
|
Some(
|
|
|
|
1,
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 3,
|
|
|
|
column: 15,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Str(
|
|
|
|
"12",
|
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
body: [
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 4,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: AnnAssign {
|
|
|
|
target: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 4,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Name {
|
|
|
|
id: "a",
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
annotation: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 4,
|
|
|
|
column: 8,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Name {
|
|
|
|
id: "int",
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
value: None,
|
|
|
|
simple: true,
|
|
|
|
config_comment: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
orelse: [],
|
|
|
|
type_comment: None,
|
|
|
|
config_comment: [
|
|
|
|
"sdf4",
|
|
|
|
"sf2",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 5,
|
|
|
|
column: 1,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: While {
|
|
|
|
test: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 7,
|
|
|
|
column: 9,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Compare {
|
|
|
|
left: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 7,
|
|
|
|
column: 7,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Name {
|
|
|
|
id: "i",
|
|
|
|
ctx: Load,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ops: [
|
|
|
|
Lt,
|
|
|
|
],
|
|
|
|
comparators: [
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 7,
|
|
|
|
column: 11,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Int(
|
2021-12-26 00:23:54 +08:00
|
|
|
Some(
|
|
|
|
2,
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
body: [
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 9,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Pass {
|
|
|
|
config_comment: [
|
|
|
|
"real pass",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 12,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Expr {
|
|
|
|
value: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 12,
|
|
|
|
column: 7,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: BinOp {
|
|
|
|
left: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 12,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Int(
|
2021-12-26 00:23:54 +08:00
|
|
|
Some(
|
|
|
|
1,
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
op: Add,
|
|
|
|
right: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 12,
|
|
|
|
column: 9,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Int(
|
2021-12-26 00:23:54 +08:00
|
|
|
Some(
|
|
|
|
2,
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
config_comment: [
|
|
|
|
"expr1",
|
|
|
|
"expr3",
|
|
|
|
"expr2",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 13,
|
|
|
|
column: 5,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: If {
|
|
|
|
test: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 15,
|
|
|
|
column: 8,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Int(
|
2021-12-26 00:23:54 +08:00
|
|
|
Some(
|
|
|
|
1,
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
body: [
|
|
|
|
Located {
|
|
|
|
location: Location {
|
|
|
|
row: 16,
|
|
|
|
column: 9,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Expr {
|
|
|
|
value: Located {
|
|
|
|
location: Location {
|
|
|
|
row: 16,
|
|
|
|
column: 9,
|
2021-12-28 01:38:16 +08:00
|
|
|
file: FileName(
|
|
|
|
"unknown",
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
},
|
|
|
|
custom: (),
|
|
|
|
node: Constant {
|
|
|
|
value: Int(
|
2021-12-26 00:23:54 +08:00
|
|
|
Some(
|
|
|
|
3,
|
|
|
|
),
|
2021-11-04 15:03:34 +08:00
|
|
|
),
|
|
|
|
kind: None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
config_comment: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
orelse: [],
|
|
|
|
config_comment: [
|
|
|
|
"if3",
|
|
|
|
"if1",
|
|
|
|
"if2",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
orelse: [],
|
|
|
|
config_comment: [
|
|
|
|
"3",
|
|
|
|
"5",
|
|
|
|
"4",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|