Skip to content

Commit d6d50d4

Browse files
committed
Fix
1 parent 991c829 commit d6d50d4

6 files changed

+7
-8
lines changed

compiler/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_1.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_2.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__parse_f_string_concat_3.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_1.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/parser/src/snapshots/rustpython_parser__string__tests__parse_u_f_string_concat_2.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/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)