Rename JoinedStr to FString in the AST (#6379)

## Summary

Per the proposal in https://github.com/astral-sh/ruff/discussions/6183,
this PR renames the `JoinedStr` node to `FString`.
This commit is contained in:
Charlie Marsh 2023-08-07 13:33:17 -04:00 committed by GitHub
parent 999d88e773
commit 3f0eea6d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 166 additions and 166 deletions

View file

@ -550,8 +550,8 @@ pub enum Expr {
Call(ExprCall),
#[is(name = "formatted_value_expr")]
FormattedValue(ExprFormattedValue),
#[is(name = "joined_str_expr")]
JoinedStr(ExprJoinedStr),
#[is(name = "f_string_expr")]
FString(ExprFString),
#[is(name = "constant_expr")]
Constant(ExprConstant),
#[is(name = "attribute_expr")]
@ -878,14 +878,14 @@ pub struct DebugText {
/// See also [JoinedStr](https://docs.python.org/3/library/ast.html#ast.JoinedStr)
#[derive(Clone, Debug, PartialEq)]
pub struct ExprJoinedStr {
pub struct ExprFString {
pub range: TextRange,
pub values: Vec<Expr>,
}
impl From<ExprJoinedStr> for Expr {
fn from(payload: ExprJoinedStr) -> Self {
Expr::JoinedStr(payload)
impl From<ExprFString> for Expr {
fn from(payload: ExprFString) -> Self {
Expr::FString(payload)
}
}
@ -2814,7 +2814,7 @@ impl Ranged for crate::nodes::ExprFormattedValue {
self.range
}
}
impl Ranged for crate::nodes::ExprJoinedStr {
impl Ranged for crate::nodes::ExprFString {
fn range(&self) -> TextRange {
self.range
}
@ -2885,7 +2885,7 @@ impl Ranged for crate::Expr {
Self::Compare(node) => node.range(),
Self::Call(node) => node.range(),
Self::FormattedValue(node) => node.range(),
Self::JoinedStr(node) => node.range(),
Self::FString(node) => node.range(),
Self::Constant(node) => node.range(),
Self::Attribute(node) => node.range(),
Self::Subscript(node) => node.range(),