MCPcopy Index your code
hub / github.com/RustPython/RustPython / compile_fstring_part_into

Method compile_fstring_part_into

crates/codegen/src/compile.rs:9982–10005  ·  view source on GitHub ↗
(
        &mut self,
        part: &ast::FStringPart,
        pending_literal: &mut Option<Wtf8Buf>,
        element_count: &mut u32,
    )

Source from the content-addressed store, hash-verified

9980 }
9981
9982 fn compile_fstring_part_into(
9983 &mut self,
9984 part: &ast::FStringPart,
9985 pending_literal: &mut Option<Wtf8Buf>,
9986 element_count: &mut u32,
9987 ) -> CompileResult<()> {
9988 match part {
9989 ast::FStringPart::Literal(string) => {
9990 let value = self.compile_fstring_part_literal_value(string);
9991 if let Some(pending) = pending_literal.as_mut() {
9992 pending.push_wtf8(value.as_ref());
9993 } else {
9994 *pending_literal = Some(value);
9995 }
9996 Ok(())
9997 }
9998 ast::FStringPart::FString(fstring) => self.compile_fstring_elements_into(
9999 fstring.flags,
10000 &fstring.elements,
10001 pending_literal,
10002 element_count,
10003 ),
10004 }
10005 }
10006
10007 fn finish_fstring(
10008 &mut self,

Callers 1

compile_expr_fstringMethod · 0.80

Calls 6

push_wtf8Method · 0.80
SomeClass · 0.50
as_mutMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected