mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-13 08:05:17 +00:00
Fix
This commit is contained in:
parent
9111cd8a3d
commit
d45ac01ebe
6 changed files with 7 additions and 8 deletions
|
@ -38,7 +38,7 @@ expression: parse_ast
|
||||||
end_location: Some(
|
end_location: Some(
|
||||||
Location {
|
Location {
|
||||||
row: 1,
|
row: 1,
|
||||||
column: 8,
|
column: 17,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
custom: (),
|
custom: (),
|
||||||
|
|
|
@ -38,7 +38,7 @@ expression: parse_ast
|
||||||
end_location: Some(
|
end_location: Some(
|
||||||
Location {
|
Location {
|
||||||
row: 1,
|
row: 1,
|
||||||
column: 8,
|
column: 17,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
custom: (),
|
custom: (),
|
||||||
|
|
|
@ -38,7 +38,7 @@ expression: parse_ast
|
||||||
end_location: Some(
|
end_location: Some(
|
||||||
Location {
|
Location {
|
||||||
row: 1,
|
row: 1,
|
||||||
column: 8,
|
column: 22,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
custom: (),
|
custom: (),
|
||||||
|
|
|
@ -38,7 +38,7 @@ expression: parse_ast
|
||||||
end_location: Some(
|
end_location: Some(
|
||||||
Location {
|
Location {
|
||||||
row: 1,
|
row: 1,
|
||||||
column: 9,
|
column: 18,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
custom: (),
|
custom: (),
|
||||||
|
|
|
@ -38,7 +38,7 @@ expression: parse_ast
|
||||||
end_location: Some(
|
end_location: Some(
|
||||||
Location {
|
Location {
|
||||||
row: 1,
|
row: 1,
|
||||||
column: 9,
|
column: 22,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
custom: (),
|
custom: (),
|
||||||
|
|
|
@ -11,7 +11,6 @@ pub fn parse_strings(
|
||||||
) -> Result<Expr, LexicalError> {
|
) -> Result<Expr, LexicalError> {
|
||||||
// Preserve the initial location and kind.
|
// Preserve the initial location and kind.
|
||||||
let initial_start = values[0].0;
|
let initial_start = values[0].0;
|
||||||
let initial_end = values[0].2;
|
|
||||||
let last_end = values.last().unwrap().2;
|
let last_end = values.last().unwrap().2;
|
||||||
let initial_kind = (values[0].1 .1 == StringKind::U).then(|| "u".to_owned());
|
let initial_kind = (values[0].1 .1 == StringKind::U).then(|| "u".to_owned());
|
||||||
|
|
||||||
|
@ -20,7 +19,7 @@ pub fn parse_strings(
|
||||||
let value = values.into_iter().last().unwrap().1 .0;
|
let value = values.into_iter().last().unwrap().1 .0;
|
||||||
return Ok(Expr::new(
|
return Ok(Expr::new(
|
||||||
initial_start,
|
initial_start,
|
||||||
initial_end,
|
last_end,
|
||||||
ExprKind::Constant {
|
ExprKind::Constant {
|
||||||
value: Constant::Str(value),
|
value: Constant::Str(value),
|
||||||
kind: initial_kind,
|
kind: initial_kind,
|
||||||
|
@ -39,7 +38,7 @@ pub fn parse_strings(
|
||||||
let take_current = |current: &mut Vec<String>| -> Expr {
|
let take_current = |current: &mut Vec<String>| -> Expr {
|
||||||
Expr::new(
|
Expr::new(
|
||||||
initial_start,
|
initial_start,
|
||||||
initial_end,
|
last_end,
|
||||||
ExprKind::Constant {
|
ExprKind::Constant {
|
||||||
value: Constant::Str(current.drain(..).join("")),
|
value: Constant::Str(current.drain(..).join("")),
|
||||||
kind: initial_kind.clone(),
|
kind: initial_kind.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue