mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-25 12:55:24 +00:00
vendor text_size and source_location (#102)
This commit is contained in:
parent
b07966695a
commit
d09bce80e6
29 changed files with 175 additions and 311 deletions
|
@ -374,7 +374,9 @@ impl<'a> StringParser<'a> {
|
|||
expression.push(ch);
|
||||
loop {
|
||||
let Some(c) = self.next_char() else {
|
||||
return Err(FStringError::new(UnterminatedString, self.get_pos()).into());
|
||||
return Err(
|
||||
FStringError::new(UnterminatedString, self.get_pos()).into()
|
||||
);
|
||||
};
|
||||
expression.push(c);
|
||||
if c == ch {
|
||||
|
@ -408,7 +410,7 @@ impl<'a> StringParser<'a> {
|
|||
spec_constructor.push(
|
||||
self.expr(
|
||||
ast::ExprConstant {
|
||||
value: constant_piece.drain(..).collect::<String>().into(),
|
||||
value: std::mem::take(&mut constant_piece).into(),
|
||||
kind: None,
|
||||
range: self.range(),
|
||||
}
|
||||
|
@ -433,7 +435,7 @@ impl<'a> StringParser<'a> {
|
|||
spec_constructor.push(
|
||||
self.expr(
|
||||
ast::ExprConstant {
|
||||
value: constant_piece.drain(..).collect::<String>().into(),
|
||||
value: std::mem::take(&mut constant_piece).into(),
|
||||
kind: None,
|
||||
range: self.range(),
|
||||
}
|
||||
|
@ -475,7 +477,7 @@ impl<'a> StringParser<'a> {
|
|||
values.push(
|
||||
self.expr(
|
||||
ast::ExprConstant {
|
||||
value: content.drain(..).collect::<String>().into(),
|
||||
value: std::mem::take(&mut content).into(),
|
||||
kind: None,
|
||||
range: self.range(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue