Skip to content

Commit 95fb938

Browse files
authored
Merge pull request #4389 from harupy/4384-follow-up
Follow-up for #4384
2 parents 9683314 + 68116d5 commit 95fb938

14 files changed

Lines changed: 286 additions & 629 deletions

‎parser/src/fstring.rs‎

Lines changed: 0 additions & 479 deletions
This file was deleted.

parser/src/snapshots/rustpython_parser__fstring__tests__fstring_parse_selfdocumenting_base.snap renamed to parser/src/snapshots/rustpython_parser__string_parser__tests__fstring_parse_selfdocumenting_base.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
source: compiler/parser/src/fstring.rs
2+
source: compiler/parser/src/string_parser.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
8-
row: 0,
8+
row: 1,
99
column: 0,
1010
},
1111
end_location: Some(
1212
Location {
13-
row: 0,
14-
column: 0,
13+
row: 1,
14+
column: 10,
1515
},
1616
),
1717
custom: (),
@@ -24,13 +24,13 @@ expression: parse_ast
2424
},
2525
Located {
2626
location: Location {
27-
row: 0,
27+
row: 1,
2828
column: 0,
2929
},
3030
end_location: Some(
3131
Location {
32-
row: 0,
33-
column: 0,
32+
row: 1,
33+
column: 10,
3434
},
3535
),
3636
custom: (),
@@ -43,26 +43,26 @@ expression: parse_ast
4343
},
4444
Located {
4545
location: Location {
46-
row: 0,
46+
row: 1,
4747
column: 0,
4848
},
4949
end_location: Some(
5050
Location {
51-
row: 0,
52-
column: 0,
51+
row: 1,
52+
column: 10,
5353
},
5454
),
5555
custom: (),
5656
node: FormattedValue {
5757
value: Located {
5858
location: Location {
5959
row: 1,
60-
column: 1,
60+
column: 3,
6161
},
6262
end_location: Some(
6363
Location {
6464
row: 1,
65-
column: 5,
65+
column: 7,
6666
},
6767
),
6868
custom: (),

parser/src/snapshots/rustpython_parser__fstring__tests__fstring_parse_selfdocumenting_base_more.snap renamed to parser/src/snapshots/rustpython_parser__string_parser__tests__fstring_parse_selfdocumenting_base_more.snap

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
source: compiler/parser/src/fstring.rs
2+
source: compiler/parser/src/string_parser.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
8-
row: 0,
8+
row: 1,
99
column: 0,
1010
},
1111
end_location: Some(
1212
Location {
13-
row: 0,
14-
column: 0,
13+
row: 1,
14+
column: 38,
1515
},
1616
),
1717
custom: (),
@@ -24,13 +24,13 @@ expression: parse_ast
2424
},
2525
Located {
2626
location: Location {
27-
row: 0,
27+
row: 1,
2828
column: 0,
2929
},
3030
end_location: Some(
3131
Location {
32-
row: 0,
33-
column: 0,
32+
row: 1,
33+
column: 38,
3434
},
3535
),
3636
custom: (),
@@ -43,13 +43,13 @@ expression: parse_ast
4343
},
4444
Located {
4545
location: Location {
46-
row: 0,
46+
row: 1,
4747
column: 0,
4848
},
4949
end_location: Some(
5050
Location {
51-
row: 0,
52-
column: 0,
51+
row: 1,
52+
column: 38,
5353
},
5454
),
5555
custom: (),
@@ -62,26 +62,26 @@ expression: parse_ast
6262
},
6363
Located {
6464
location: Location {
65-
row: 0,
65+
row: 1,
6666
column: 0,
6767
},
6868
end_location: Some(
6969
Location {
70-
row: 0,
71-
column: 0,
70+
row: 1,
71+
column: 38,
7272
},
7373
),
7474
custom: (),
7575
node: FormattedValue {
7676
value: Located {
7777
location: Location {
7878
row: 1,
79-
column: 1,
79+
column: 7,
8080
},
8181
end_location: Some(
8282
Location {
8383
row: 1,
84-
column: 5,
84+
column: 11,
8585
},
8686
),
8787
custom: (),
@@ -96,13 +96,13 @@ expression: parse_ast
9696
},
9797
Located {
9898
location: Location {
99-
row: 0,
99+
row: 1,
100100
column: 0,
101101
},
102102
end_location: Some(
103103
Location {
104-
row: 0,
105-
column: 0,
104+
row: 1,
105+
column: 38,
106106
},
107107
),
108108
custom: (),
@@ -115,13 +115,13 @@ expression: parse_ast
115115
},
116116
Located {
117117
location: Location {
118-
row: 0,
118+
row: 1,
119119
column: 0,
120120
},
121121
end_location: Some(
122122
Location {
123-
row: 0,
124-
column: 0,
123+
row: 1,
124+
column: 38,
125125
},
126126
),
127127
custom: (),
@@ -134,13 +134,13 @@ expression: parse_ast
134134
},
135135
Located {
136136
location: Location {
137-
row: 0,
137+
row: 1,
138138
column: 0,
139139
},
140140
end_location: Some(
141141
Location {
142-
row: 0,
143-
column: 0,
142+
row: 1,
143+
column: 38,
144144
},
145145
),
146146
custom: (),
@@ -153,26 +153,26 @@ expression: parse_ast
153153
},
154154
Located {
155155
location: Location {
156-
row: 0,
156+
row: 1,
157157
column: 0,
158158
},
159159
end_location: Some(
160160
Location {
161-
row: 0,
162-
column: 0,
161+
row: 1,
162+
column: 38,
163163
},
164164
),
165165
custom: (),
166166
node: FormattedValue {
167167
value: Located {
168168
location: Location {
169169
row: 1,
170-
column: 1,
170+
column: 29,
171171
},
172172
end_location: Some(
173173
Location {
174174
row: 1,
175-
column: 7,
175+
column: 35,
176176
},
177177
),
178178
custom: (),

parser/src/snapshots/rustpython_parser__fstring__tests__fstring_parse_selfdocumenting_format.snap renamed to parser/src/snapshots/rustpython_parser__string_parser__tests__fstring_parse_selfdocumenting_format.snap

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
source: compiler/parser/src/fstring.rs
2+
source: compiler/parser/src/string_parser.rs
33
expression: parse_ast
44
---
55
[
66
Located {
77
location: Location {
8-
row: 0,
8+
row: 1,
99
column: 0,
1010
},
1111
end_location: Some(
1212
Location {
13-
row: 0,
14-
column: 0,
13+
row: 1,
14+
column: 14,
1515
},
1616
),
1717
custom: (),
@@ -24,13 +24,13 @@ expression: parse_ast
2424
},
2525
Located {
2626
location: Location {
27-
row: 0,
27+
row: 1,
2828
column: 0,
2929
},
3030
end_location: Some(
3131
Location {
32-
row: 0,
33-
column: 0,
32+
row: 1,
33+
column: 14,
3434
},
3535
),
3636
custom: (),
@@ -43,26 +43,26 @@ expression: parse_ast
4343
},
4444
Located {
4545
location: Location {
46-
row: 0,
46+
row: 1,
4747
column: 0,
4848
},
4949
end_location: Some(
5050
Location {
51-
row: 0,
52-
column: 0,
51+
row: 1,
52+
column: 14,
5353
},
5454
),
5555
custom: (),
5656
node: FormattedValue {
5757
value: Located {
5858
location: Location {
5959
row: 1,
60-
column: 1,
60+
column: 3,
6161
},
6262
end_location: Some(
6363
Location {
6464
row: 1,
65-
column: 5,
65+
column: 7,
6666
},
6767
),
6868
custom: (),
@@ -75,27 +75,27 @@ expression: parse_ast
7575
format_spec: Some(
7676
Located {
7777
location: Location {
78-
row: 0,
78+
row: 1,
7979
column: 0,
8080
},
8181
end_location: Some(
8282
Location {
83-
row: 0,
84-
column: 0,
83+
row: 1,
84+
column: 14,
8585
},
8686
),
8787
custom: (),
8888
node: JoinedStr {
8989
values: [
9090
Located {
9191
location: Location {
92-
row: 0,
92+
row: 1,
9393
column: 0,
9494
},
9595
end_location: Some(
9696
Location {
97-
row: 0,
98-
column: 0,
97+
row: 1,
98+
column: 14,
9999
},
100100
),
101101
custom: (),

parser/src/snapshots/rustpython_parser__fstring__tests__parse_empty_fstring.snap renamed to parser/src/snapshots/rustpython_parser__string_parser__tests__parse_empty_fstring.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: compiler/parser/src/fstring.rs
2+
source: compiler/parser/src/string_parser.rs
33
expression: "parse_fstring(\"\").unwrap()"
44
---
55
[]

0 commit comments

Comments
 (0)