mirror of
https://github.com/RustPython/Parser.git
synced 2025-09-03 17:10:58 +00:00
reorganize compiler crates
This commit is contained in:
parent
3351b4408b
commit
060d153bb3
82 changed files with 12368 additions and 164 deletions
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"user=",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 114,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"mix ",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"user=",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 114,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
" with text and ",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"second=",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "second",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 114,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"user=",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
">10",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: "parse_fstring(\"\").unwrap()"
|
||||
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "b",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"{foo}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
custom: (),
|
||||
node: Compare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
42,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
ops: [
|
||||
Eq,
|
||||
],
|
||||
comparators: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
42,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "foo",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "spec",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
custom: (),
|
||||
node: Compare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
ops: [
|
||||
NotEq,
|
||||
],
|
||||
comparators: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "foo",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"spec",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"x =",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 114,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"x=",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
" ",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
conversion: 114,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
source: parser/src/fstring.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 0,
|
||||
column: 0,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Yield {
|
||||
value: None,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_program(&source).unwrap()
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: ClassDef {
|
||||
name: "Foo",
|
||||
bases: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "A",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "B",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "__init__",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 15,
|
||||
},
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "self",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "method_with_default",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 26,
|
||||
},
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "self",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 32,
|
||||
},
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "arg",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 37,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"default",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 5,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: DictComp {
|
||||
key: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x1",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x2",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "z",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [],
|
||||
is_async: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,178 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: ListComp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y2",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "z",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [],
|
||||
is_async: 0,
|
||||
},
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 23,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 28,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "b",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 35,
|
||||
},
|
||||
custom: (),
|
||||
node: Compare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 33,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ops: [
|
||||
Lt,
|
||||
],
|
||||
comparators: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 37,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
5,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 44,
|
||||
},
|
||||
custom: (),
|
||||
node: Compare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 42,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ops: [
|
||||
Gt,
|
||||
],
|
||||
comparators: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 46,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
10,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
is_async: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[]
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "z",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [],
|
||||
is_async: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: If {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
10,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
orelse: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: If {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 6,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 9,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 9,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
20,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
orelse: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,83 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
custom: (),
|
||||
node: IfExp {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
body: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
orelse: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 25,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "z",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [],
|
||||
is_async: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "my_func",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"positional",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
keywords: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 23,
|
||||
},
|
||||
custom: (),
|
||||
node: KeywordData {
|
||||
arg: Some(
|
||||
"keyword",
|
||||
),
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 31,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,90 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Lambda {
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "x",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "y",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 16,
|
||||
},
|
||||
custom: (),
|
||||
node: BinOp {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
op: Mult,
|
||||
right: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: ListComp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "z",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [],
|
||||
is_async: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: NamedExpr {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
},
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
custom: (),
|
||||
node: BinOp {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
op: Add,
|
||||
right: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "z",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
ifs: [],
|
||||
is_async: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,91 @@
|
|||
---
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_program(&source).unwrap()
|
||||
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "b",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
],
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
4,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
5,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"!",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: Some(
|
||||
"u",
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world!",
|
||||
),
|
||||
kind: Some(
|
||||
"u",
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: Some(
|
||||
"u",
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue