Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rename the string nodes for better understanding between the types. The following renames are performed:
Enum variants:
Expr::StringLiteral
->Expr::String
Expr::BytesLiteral
->Expr::Bytes
FStringPart::Literal
->FStringPart::String
- This includes the string literal part of an implictly concatenated f-string (e.g."foo" f"bar {x}"
)FStringExprValue::literals
->FStringExprValue::strings
AST nodes:
ExprStringLiteral
->ExprString
ExprBytesLiteral
->ExprBytes
To better reflect that the following are expressions:
StringValue
->StringExprValue
BytesValue
->BytesExprValue
FStringValue
->FStringExprValue
Open ended renames
LiteralExpressionRef::StringLiteral
->LiteralExpressionRef::String
(enum variant)LiteralExpressionRef::BytesLiteral
->LiteralExpressionRef::Bytes
(enum variant)StringLike::StringLiteral
->StringLike::String
(enum variant)StringLike::BytesLiteral
->StringLike::Bytes
(enum variant)FStringElement
/FStringPart
->FStringComponent
(enum type)FString
toFormattedString
everywhere (struct, enum)LibCST f-string names: https://github.com/Instagram/LibCST/blob/52bbff6dfc2dd7b3086710bc64896ccfaaed1a3d/native/libcst/src/nodes/expression.rs#L2430-L2443
FormattedString
FormattedStringContent
(akaFStringElement
)FormattedStringText
(akaFStringLiteralElement
)FormattedStringExpression
(akaFStringExpressionElement
)I like the rename of
FStringElement
toFStringContent
as "content" better describes the value between the quotes or a "string content".Reference: