Skip to content

Commit 99b02be

Browse files
committed
Fix
1 parent f99167d commit 99b02be

6 files changed

Lines changed: 7 additions & 8 deletions

‎parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ expression: parse_ast
3838
end_location: Some(
3939
Location {
4040
row: 1,
41-
column: 8,
41+
column: 17,
4242
},
4343
),
4444
custom: (),

‎parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ expression: parse_ast
3838
end_location: Some(
3939
Location {
4040
row: 1,
41-
column: 8,
41+
column: 17,
4242
},
4343
),
4444
custom: (),

‎parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ expression: parse_ast
3838
end_location: Some(
3939
Location {
4040
row: 1,
41-
column: 8,
41+
column: 22,
4242
},
4343
),
4444
custom: (),

‎parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_1.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ expression: parse_ast
3838
end_location: Some(
3939
Location {
4040
row: 1,
41-
column: 9,
41+
column: 18,
4242
},
4343
),
4444
custom: (),

‎parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_2.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ expression: parse_ast
3838
end_location: Some(
3939
Location {
4040
row: 1,
41-
column: 9,
41+
column: 22,
4242
},
4343
),
4444
custom: (),

‎parser/src/string.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn parse_strings(
1111
) -> Result<Expr, LexicalError> {
1212
// Preserve the initial location and kind.
1313
let initial_start = values[0].0;
14-
let initial_end = values[0].2;
1514
let last_end = values.last().unwrap().2;
1615
let initial_kind = (values[0].1 .1 == StringKind::U).then(|| "u".to_owned());
1716

@@ -20,7 +19,7 @@ pub fn parse_strings(
2019
let value = values.into_iter().last().unwrap().1 .0;
2120
return Ok(Expr::new(
2221
initial_start,
23-
initial_end,
22+
last_end,
2423
ExprKind::Constant {
2524
value: Constant::Str(value),
2625
kind: initial_kind,
@@ -39,7 +38,7 @@ pub fn parse_strings(
3938
let take_current = |current: &mut Vec<String>| -> Expr {
4039
Expr::new(
4140
initial_start,
42-
initial_end,
41+
last_end,
4342
ExprKind::Constant {
4443
value: Constant::Str(current.drain(..).join("")),
4544
kind: initial_kind.clone(),

0 commit comments

Comments
 (0)