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

Method unparse_interpolated_string

crates/ruff_python_codegen/src/generator.rs:1601–1613  ·  view source on GitHub ↗

Unparse `values` with [`Generator::unparse_f_string_body`], using `quote` as the preferred surrounding quote style.

(
        &mut self,
        values: &[ast::InterpolatedStringElement],
        flags: AnyStringFlags,
    )

Source from the content-addressed store, hash-verified

1599 /// Unparse `values` with [`Generator::unparse_f_string_body`], using `quote` as the preferred
1600 /// surrounding quote style.
1601 fn unparse_interpolated_string(
1602 &mut self,
1603 values: &[ast::InterpolatedStringElement],
1604 flags: AnyStringFlags,
1605 ) {
1606 self.p(flags.prefix().as_str());
1607
1608 let quote_style = self.mode.quote_style(flags);
1609 let flags = flags.with_quote_style(quote_style);
1610 self.p(flags.quote_str());
1611 self.unparse_interpolated_string_body(values, flags);
1612 self.p(flags.quote_str());
1613 }
1614
1615 fn unparse_t_string_value(&mut self, value: &ast::TStringValue) {
1616 let mut first = true;

Callers 2

Calls 7

pMethod · 0.80
quote_strMethod · 0.80
as_strMethod · 0.45
prefixMethod · 0.45
quote_styleMethod · 0.45
with_quote_styleMethod · 0.45

Tested by

no test coverage detected