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

Method unparse_interpolated_string

crates/ruff_python_codegen/src/generator.rs:1586–1598  ·  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

1584 /// Unparse `values` with [`Generator::unparse_f_string_body`], using `quote` as the preferred
1585 /// surrounding quote style.
1586 fn unparse_interpolated_string(
1587 &mut self,
1588 values: &[ast::InterpolatedStringElement],
1589 flags: AnyStringFlags,
1590 ) {
1591 self.p(flags.prefix().as_str());
1592
1593 let quote_style = self.mode.quote_style(flags);
1594 let flags = flags.with_quote_style(quote_style);
1595 self.p(flags.quote_str());
1596 self.unparse_interpolated_string_body(values, flags);
1597 self.p(flags.quote_str());
1598 }
1599
1600 fn unparse_t_string_value(&mut self, value: &ast::TStringValue) {
1601 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