MCPcopy Create free account
hub / github.com/astral-sh/ruff / parts

Method parts

crates/ruff_python_ast/src/expression.rs:98–105  ·  view source on GitHub ↗

Returns an iterator over the [`StringLikePart`] contained in this string-like expression.

(&self)

Source from the content-addressed store, hash-verified

96
97 /// Returns an iterator over the [`StringLikePart`] contained in this string-like expression.
98 pub fn parts(&self) -> StringLikePartIter<'a> {
99 match self {
100 StringLike::String(expr) => StringLikePartIter::String(expr.value.iter()),
101 StringLike::Bytes(expr) => StringLikePartIter::Bytes(expr.value.iter()),
102 StringLike::FString(expr) => StringLikePartIter::FString(expr.value.iter()),
103 StringLike::TString(expr) => StringLikePartIter::TString(expr.value.iter()),
104 }
105 }
106
107 /// Returns `true` if the string is implicitly concatenated.
108 pub fn is_implicit_concatenated(self) -> bool {

Callers 10

is_multilineMethod · 0.45
fmtMethod · 0.45
merge_flagsMethod · 0.45
check_string_quotesFunction · 0.45
avoidable_escaped_quoteFunction · 0.45
invalid_escape_sequenceFunction · 0.45

Calls 4

BytesClass · 0.85
TStringClass · 0.85
FStringClass · 0.70
iterMethod · 0.45

Tested by

no test coverage detected